Trigger push_gem from script/publish and allow manual dispatch - #2702
Merged
Conversation
Publishing 4.14.0 tagged v4.14.0 and created the GitHub release, but push_gem.yml did not run and no gem was pushed to RubyGems. Root cause: GitHub Actions does not trigger downstream workflows for events driven by GITHUB_TOKEN. script/publish now runs inside the publish-release workflow, which uses GITHUB_TOKEN for its checkout — so the 'git push origin v4.14.0' from that job does not fire the 'push: tags: v*' event on push_gem.yml. Previous releases were tagged by a maintainer running script/publish locally with a PAT, which is why push_gem always fired for them. Two changes: - Add a workflow_dispatch trigger to push_gem.yml with a required 'tag' input, and check that tag out. This lets a maintainer manually push the gem for a specific tag (needed right now to publish v4.14.0 to RubyGems). - At the end of script/publish, dispatch push_gem.yml with the freshly created tag. || true so any dispatch failure never masks a successful release. This makes future releases push the gem automatically even when script/publish runs from Actions. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 217f0a0d-a9f2-4607-9643-5fcb3e34f20f
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.
Diagnosis of the "push_gem published v4.13.0, not v4.14.0" confusion:
releaseenvironment approval; it finally completed today (99h50m). That's the run you saw.Root cause
GitHub Actions does not trigger downstream workflows for events driven by
GITHUB_TOKEN.script/publishnow runs inside thepublish-releasejob, which usesGITHUB_TOKENfor its checkout, sogit push origin v4.14.0from that job does not fire thepush: tags: v*event onpush_gem.yml. Previous releases were tagged by a maintainer runningscript/publishlocally with a PAT — that's whypush_gemalways fired historically.Fix
Two changes:
workflow_dispatchtopush_gem.ymlwith a requiredtaginput, and check that tag out (ref: inputs.tag). Lets a maintainer manually push the gem for a specific tag — needed right now to publish v4.14.0 to RubyGems.push_gem.ymlfromscript/publishaftergh release create, passing the freshly created tag.|| trueso any dispatch failure never masks a successful release. Future releases will push the gem automatically even whenscript/publishruns from Actions.Recovery for v4.14.0
Once this merges: Actions → Push Gem → Run workflow → tag:
v4.14.0. That will check out the v4.14.0 tag and push the gem to RubyGems via Trusted Publishing (still gated on thereleaseenvironment approval).