Repository navigation
👷 release on push to main and check the tag on the remote (#125) - #126
Merged
Merged
Conversation
pull_request events from forks get a read-only GITHUB_TOKEN, so merging monkut#124 failed to create v0.2.16 (403). A push to main runs with the repository token whichever branch the PR came from. actions/checkout fetches no tags, so the local 'git rev-parse v$VERSION' check never found an existing tag and a merge without a version bump failed (422). Ask the remote with git ls-remote instead.
monkut
approved these changes
Oct 8, 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.
Closes #125
Problem
The release workflow's last two runs failed in "Create release":
pull_requestevents from a fork get a read-onlyGITHUB_TOKENregardless ofpermissions: contents: write, sogh release create v0.2.16was refused.v0.2.16was never published.git rev-parse v$VERSION, butactions/checkout@v4fetches no tags. The check always said the tag was missing, so the job tried to re-createv0.2.15.Change (
.github/workflows/release.ymlonly)pushtomaininstead ofpull_request: closedplus themerged == trueguard. A push runs with the repository's own token, whether the merged PR came from this repo or a fork.git ls-remote --exit-code --tags origin refs/tags/<tag>, so a merge without a version bump skips the release instead of failing.The test and release jobs are otherwise unchanged.
Verification
actionlint(1.7.12): clean. The YAML parses, and the trigger ispush: branches: [main].v0.2.15gives exists=true,v0.2.16gives exists=false.Effect on merge
This merge is itself a push to
mainwithpyproject.tomlat 0.2.16 and nov0.2.16tag, so the fixed workflow should publish v0.2.16 automatically. If v0.2.16 has already been created by hand, the run skips the release step.