From 3f847729908e976732a9a45ebc877690e7551cbe Mon Sep 17 00:00:00 2001 From: allen0099 Date: Fri, 25 Sep 2026 16:18:50 +0000 Subject: [PATCH] ci: upload the coverage badge only on pushes to master The Coverage Badge workflow runs on pull requests too, and its last step pushed the badge to the coverage-badge branch every time. A pull request from a branch in this repository overwrote master's badge with the pull request's coverage. A pull request from a fork gets a read-only token, so the push failed with 403 and the check went red even though tests and coverage passed (seen on #150). Run the upload step only for push events. Pull requests still run the suite against live servers and enforce the coverage gate. --- .github/workflows/coverage.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 57bb873..220e290 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -65,6 +65,10 @@ jobs: CACHEX_REQUIRE_LIVE_SERVERS: 1 - name: Upload coverage badge + # Only a push to master updates the badge. A pull request's coverage is + # not master's, and a fork's pull request gets a read-only token, so the + # push would fail with 403 and turn the check red. + if: github.event_name == 'push' uses: JamesIves/github-pages-deploy-action@v4 with: branch: coverage-badge