Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
name: CI

on:
workflow_dispatch:
push:
branches: [main]
paths-ignore:
- 'docs/**'
- '*.md'
- '.github/workflows/docs.yml'
pull_request:
branches: [main]
paths-ignore:
Expand Down Expand Up @@ -69,17 +66,17 @@ jobs:
echo "color=$color" >> "$GITHUB_OUTPUT"
echo "::notice::Total coverage: ${pct}% (${color})"

# Hand the badge to the push-only update-coverage-badge job below via
# an artifact. PRs (including forks) still run the compute step above
# for visibility, but skip the upload so they can never trigger a push.
# Hand the badge to the update-coverage-badge job below via an artifact.
# PRs (including forks) still run the compute step above for visibility,
# but skip the upload so they can never trigger a push.
#
# include-hidden-files: true is required — the badge lives under
# .github/, and actions/upload-artifact defaults to excluding files
# whose path contains any dot-prefixed segment. Without this the
# upload would silently match nothing and, combined with
# if-no-files-found: error, fail the build job on every push to main.
- name: Upload coverage badge artifact
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/main'
uses: actions/upload-artifact@v5
with:
name: coverage-badge
Expand All @@ -91,9 +88,9 @@ jobs:
update-coverage-badge:
name: Commit coverage badge
needs: build
# Gate the entire job — not just individual steps — on push-to-main so
# Gate the entire job — not just individual steps — on main-only events so
# the contents: write token below is never issued for pull_request runs.
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
contents: write
Expand Down
Loading