Skip to content

👷 release on push to main and check the tag on the remote (#125) - #126

Merged
monkut merged 1 commit into
monkut:mainfrom
ellen-goc:fix/125-release-workflow
Oct 8, 2026
Merged

monkut merged 1 commit into
monkut:mainfrom
ellen-goc:fix/125-release-workflow

Conversation

@ellen-goc

Copy link
Copy Markdown
Contributor

Closes #125

Problem

The release workflow's last two runs failed in "Create release":

Change (.github/workflows/release.yml only)

  • Trigger on push to main instead of pull_request: closed plus the merged == true guard. A push runs with the repository's own token, whether the merged PR came from this repo or a fork.
  • Check for the tag with 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 is push: branches: [main].
  • The tag check against this repo's remote: v0.2.15 gives exists=true, v0.2.16 gives exists=false.

Effect on merge

This merge is itself a push to main with pyproject.toml at 0.2.16 and no v0.2.16 tag, 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.

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
monkut merged commit 16d1553 into monkut:main Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Release workflow fails for fork PRs (403) and for merges without a version bump (422)

2 participants