ci: auto-publish gem from release-please run (hexlet-ide pattern)#11
Merged
Conversation
GitHub deliberately blocks GITHUB_TOKEN-triggered events from starting other workflows, so a release created by release-please never fired the release:published-based publish-gem workflow. Rather than introduce a PAT, fold publishing into the release workflow as a downstream job gated on the action's release_created output (the same pattern used in hexlet-ide): the publish job runs in the same workflow invocation that cuts the release, so no cross-workflow trigger is needed. Rename release-please.yml to release.yml (release-please + publish jobs) and reduce publish-gem.yml to a manual workflow_dispatch fallback for re-publishing an existing release. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Why
GitHub deliberately blocks events triggered by
GITHUB_TOKENfrom starting other workflows (anti-recursion guardrail — there is no setting to allow it). So the release that release-please creates underGITHUB_TOKENnever fired therelease: published-basedpublish-gem.yml, and0.4.3had to be published manually.What
Fold publishing into the release workflow as a downstream job gated on the action's
release_createdoutput — the same two-job pattern ashexlet-ide'srelease.yml. Thepublishjob runs in the same workflow invocation that cuts the release, so no cross-workflow trigger (and no PAT) is needed.release-please.yml→release.ymlwith two jobs:release-please(googleapis/release-please-action@v5) exposingrelease_created/versionoutputs;publish—needs: release-please,if: needs.release-please.outputs.release_created == 'true'— sets up Ruby and runsbin/publish-gemwith the existingGEM_HOST_API_KEYsecret.publish-gem.ymlto a manualworkflow_dispatchfallback (dropped the deadrelease: publishedtrigger) for re-publishing an existing release.After this merges, future releases publish to RubyGems automatically when the release PR is merged.
🤖 Generated with Claude Code