Skip to content

fix: skip stale release workflow runs - #253

Merged
giscebot merged 2 commits into
mainfrom
fix/release-workflow-sha
Oct 6, 2026
Merged

giscebot merged 2 commits into
mainfrom
fix/release-workflow-sha

Conversation

@giscebot

@giscebot giscebot commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Check out the exact workflow SHA with full history before restoring the release branch.
  • Skip validation and publication when main has advanced past the triggering SHA.
  • Recheck the remote head immediately before semantic release.
  • Add regression coverage and document the stale-run behavior.

Cause

Run 37429064394 checked out a newer shallow main after another PR merged, then could not reset to the older triggering SHA because that object was absent. Releasing that stale SHA would also be unsafe, so stale runs now finish without publishing and leave the newest queued run to release the current head.

Validation

  • Focused workflow tests: 2 passed
  • Full Python suite in a clean CI-like environment: 433 passed
  • Real remote comparison identifies c8395f2 as stale against current main

Requested by: @pilipilisbot

giscebot and others added 2 commits October 6, 2026 09:40
Co-authored-by: pilipilisbot <pilipilisbot@users.noreply.github.com>
Co-authored-by: pilipilisbot <pilipilisbot@users.noreply.github.com>
@pilipilisbot

Copy link
Copy Markdown
Collaborator

Validated PR head 4b9176be6815978bc80960e3cdda4e0837dc670a.

What I checked:

  • The release workflow now checks out the triggering ${{ github.sha }} with full history before restoring the branch name.
  • Stale queued runs skip install/test/build/release when origin/${GITHUB_REF_NAME} no longer matches the triggering SHA.
  • A second remote-head check gates python-semantic-release immediately before publishing.

Local validation:

  • .venv/bin/pytest -q tests/test_release_workflow.py -> 2 passed
  • .venv/bin/pytest -q -> 433 passed, 1 existing Starlette/httpx deprecation warning

No extra code changes were needed beyond the current PR diff.

@giscebot
giscebot merged commit aff5fe4 into main Oct 6, 2026
3 checks passed
@giscebot
giscebot deleted the fix/release-workflow-sha branch October 6, 2026 09:44
@pilipilisbot

Copy link
Copy Markdown
Collaborator

Post-merge follow-up for PR #253:

Only follow-up noticed: GitHub emitted a non-blocking Node.js 20 deprecation annotation for some Actions versions; it did not block this release.

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.

2 participants