Context
.github/workflows/github-release.yml exposes a workflow_dispatch input named release-branch (default "main")
that is used as ref: in the checkout step and as the explicit target of git push origin "$RELEASE_BRANCH" in the
lockfile commit step.
That input is redundant with GitHub's built-in "Use workflow from" dropdown (the dispatch ref) and creates a latent
silent-failure path when the two values diverge. The convention of "set them to the same value" hides the failure
mode but doesn't prevent it.
Problem / Current Behaviour
The dispatch ref (the dropdown) sets github.ref / github.ref_name inside the run AND workflow_run.head_branch
for any downstream listener (e.g. bundle-pypi-wheels.yml). The release-branch input does NOT influence any of
those; it only controls what actions/checkout writes into the working tree.
Failure scenario today: a release dispatched with dropdown = main but input = release/0.36.0.
github-release.yml correctly checks out release/0.36.0, bumps + tags + pushes to it.
- GitHub fires
workflow_run with head_branch = main (the dispatch ref, frozen at dispatch time).
bundle-pypi-wheels.yml resolves ref: ${{ github.event.workflow_run.head_branch || ... }} → main, checks
out main's tip.
- Working tree is old-version source.
cibuildwheel builds old-version wheels.
gh release view returns the new tag. gh release upload <new tag> dist/*.whl attaches the old wheels under
the new tag. PyPI publishes the wrong wheels.
This only fails to happen today because the dispatching convention is to keep both fields equal. Nothing in the
workflow enforces it.
Affected locations
| File |
Symbol |
Notes |
.github/workflows/github-release.yml |
on.workflow_dispatch.inputs.release-branch |
The redundant input. |
.github/workflows/github-release.yml |
release job → "Checkout repository" |
ref: ${{ inputs.release-branch }} to remove. |
.github/workflows/github-release.yml |
release job → "Commit and push updated lockfile" |
env.RELEASE_BRANCH + git push origin "$RELEASE_BRANCH" to simplify. |
Steps to Reproduce / Motivation Example
Today the input is used like this (excerpt):
on:
workflow_dispatch:
inputs:
release-branch:
description: "Branch to create release from"
required: false
default: "main"
jobs:
release:
steps:
- uses: actions/checkout@…
with:
fetch-depth: 0
ref: ${{ inputs.release-branch }}
…
- name: Commit and push updated lockfile
env:
RELEASE_BRANCH: ${{ inputs.release-branch }}
run: |
…
git push origin "$RELEASE_BRANCH"
workflow_run.head_branch carries the dispatch ref, not inputs.release-branch. Recent runs confirm this
(every headBranch value matches the release branch the user picked in the dropdown):
28050001891 → release/0.36.0, 27647051513 → release/0.35.0, 27511221111 → release/0.34.0,
27495839883 → release/0.33.0, 27109197153 → release/0.32.0.
Proposed Solution
Three small edits in .github/workflows/github-release.yml:
on:
workflow_dispatch:
inputs:
- release-branch:
- description: "Branch to create release from"
- required: false
- default: "main"
increment:
…
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
- ref: ${{ inputs.release-branch }}
- name: Commit and push updated lockfile
- env:
- RELEASE_BRANCH: ${{ inputs.release-branch }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add pixi.lock
git diff --cached --quiet && echo "No lockfile changes" && exit 0
git commit -m "build: sync pixi.lock after version bump"
- git push origin "$RELEASE_BRANCH"
+ git push
actions/checkout without ref: defaults to github.ref (the dispatch ref). After the checkout above, git push
in the lockfile step pushes the current branch back to its tracking remote — same end result as the explicit
git push origin "$RELEASE_BRANCH".
How to use after the change:
- Create
release/<version> from main locally and push it (unchanged from today).
- Actions →
github-release → "Run workflow" → pick release/<version> in the "Use workflow from" dropdown.
- Fill
increment, prerelease_type, draft. No more release-branch field.
- Downstream
bundle-pypi-wheels.yml keeps working because workflow_run.head_branch still equals
release/<version> (same value that today's correct runs already produce — see the run IDs above).
Out of Scope
- Any change to
bundle-pypi-wheels.yml. The chain is unaffected when the dispatch ref equals the release branch
(which becomes the only supported flow after this change).
- Moving release-branch creation into the workflow itself (separate design discussion —
workflow_run cannot carry
a branch created mid-run).
- Any change to the
release/github composite action.
Effort Estimate
Size: XS
Rationale: three localised edits in one file; one manual end-to-end release run to verify.
Definition of Done
Context
.github/workflows/github-release.ymlexposes aworkflow_dispatchinput namedrelease-branch(default"main")that is used as
ref:in the checkout step and as the explicit target ofgit push origin "$RELEASE_BRANCH"in thelockfile commit step.
That input is redundant with GitHub's built-in "Use workflow from" dropdown (the dispatch ref) and creates a latent
silent-failure path when the two values diverge. The convention of "set them to the same value" hides the failure
mode but doesn't prevent it.
Problem / Current Behaviour
The dispatch ref (the dropdown) sets
github.ref/github.ref_nameinside the run ANDworkflow_run.head_branchfor any downstream listener (e.g.
bundle-pypi-wheels.yml). Therelease-branchinput does NOT influence any ofthose; it only controls what
actions/checkoutwrites into the working tree.Failure scenario today: a release dispatched with dropdown =
mainbut input =release/0.36.0.github-release.ymlcorrectly checks outrelease/0.36.0, bumps + tags + pushes to it.workflow_runwithhead_branch = main(the dispatch ref, frozen at dispatch time).bundle-pypi-wheels.ymlresolvesref: ${{ github.event.workflow_run.head_branch || ... }}→main, checksout
main's tip.cibuildwheelbuilds old-version wheels.gh release viewreturns the new tag.gh release upload <new tag> dist/*.whlattaches the old wheels underthe new tag. PyPI publishes the wrong wheels.
This only fails to happen today because the dispatching convention is to keep both fields equal. Nothing in the
workflow enforces it.
Affected locations
.github/workflows/github-release.ymlon.workflow_dispatch.inputs.release-branch.github/workflows/github-release.ymlreleasejob → "Checkout repository"ref: ${{ inputs.release-branch }}to remove..github/workflows/github-release.ymlreleasejob → "Commit and push updated lockfile"env.RELEASE_BRANCH+git push origin "$RELEASE_BRANCH"to simplify.Steps to Reproduce / Motivation Example
Today the input is used like this (excerpt):
workflow_run.head_branchcarries the dispatch ref, notinputs.release-branch. Recent runs confirm this(every
headBranchvalue matches the release branch the user picked in the dropdown):28050001891 → release/0.36.0,27647051513 → release/0.35.0,27511221111 → release/0.34.0,27495839883 → release/0.33.0,27109197153 → release/0.32.0.Proposed Solution
Three small edits in
.github/workflows/github-release.yml:actions/checkoutwithoutref:defaults togithub.ref(the dispatch ref). After the checkout above,git pushin the lockfile step pushes the current branch back to its tracking remote — same end result as the explicit
git push origin "$RELEASE_BRANCH".How to use after the change:
release/<version>frommainlocally and push it (unchanged from today).github-release→ "Run workflow" → pickrelease/<version>in the "Use workflow from" dropdown.increment,prerelease_type,draft. No morerelease-branchfield.bundle-pypi-wheels.ymlkeeps working becauseworkflow_run.head_branchstill equalsrelease/<version>(same value that today's correct runs already produce — see the run IDs above).Out of Scope
bundle-pypi-wheels.yml. The chain is unaffected when the dispatch ref equals the release branch(which becomes the only supported flow after this change).
workflow_runcannot carrya branch created mid-run).
release/githubcomposite action.Effort Estimate
Size:
XSRationale: three localised edits in one file; one manual end-to-end release run to verify.
Definition of Done
release-branchinput removed from.github/workflows/github-release.yml.ref:line).git pushand theRELEASE_BRANCHenv block is removed.release/<test-version>branch (dispatched via the dropdown) producescorrectly-versioned wheels attached to the new tag and published to PyPI under that new version.
inputs.release-branchanywhere in the workflow file.