ci: upload the coverage badge only on pushes to master - #151
Merged
Merged
Conversation
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.
allen0099
added a commit
that referenced
this pull request
Sep 25, 2026
…ease test_the_repository_changelog_can_be_released promotes the real CHANGELOG.md. Right after a release its `## [Unreleased]` section is empty, and promote() rightly refuses an empty section, so the test failed on master from the 0.3.7 release until the next changelog entry. That turned the Coverage Badge and Test runs red on master and on pull requests without a changelog entry (#151). When the section is empty, the test now gives it a placeholder entry before promoting, so the rest of the file (heading order and the compare links) is still checked. A non-empty section is left as it is.
This was referenced Sep 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The Coverage Badge workflow runs on both
pushto master andpull_request. Until now its last step, "Upload coverage badge", pushedcoverage.svgto thecoverage-badgebranch on every run. That causes two problems:GITHUB_TOKEN, so the push failed with403and turned thecoveragecheck red. On feat: add CacheLock and the expire_if_equals backend primitive #150 this happened even though all 780 tests passed with live Redis and Memcached and coverage was 100%.The upload step now runs only when
github.event_name == 'push'. Pull requests still run the suite against the live servers and still enforce the coverage gate. They just no longer publish the badge.Verified
actionlintreports nothing new. Its one note, SC2102 on thegenbadge[coverage]line, is also on master.coverage.yml, so the workflow runs on it. The upload step should show as skipped.