fix(ci): backport CD (Production) deploy-gate fix in hotfix-start - #767
Merged
Conversation
Hotfix branches are cut from release tags via `git checkout -b <branch> <tag>`, so they inherit whatever CD_production.yml existed at that tag. Tags cut before the deploy-gate fix carry a `production-deploy` gate keyed on `github.event_name == 'workflow_call'` — never true inside a called workflow, which inherits the caller's `push` event — so release-please's inline deploy skips and the hotfix never ships. After creating the branch, surgically rewrite the gate to key on `inputs.tag_name` (empty on the release-event path, so `||` falls through). Surgical sed only, not a whole-file copy from the default branch, whose deploy steps may not match the tag's code (e.g. the renamed refresh-materialized-views CLI, pg_cron, Secret Manager fetch). Co-Authored-By: Claude Opus 4.8 <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.
Third of three PRs fixing the "hotfix merge doesn't deploy production" bug (see #765 hotfix/v1.1.3, #766 production).
Why this one
hotfix-start.ymlseeds a hotfix branch withgit checkout -b <branch> <tag>, so the branch inheritsCD_production.ymlas it was at that tag. Every existingv1.1.xtag predates the deploy-gate fix, so any future hotfix cut from them reinherits the broken gate:github.event_nameis never'workflow_call'inside a called workflow (it inherits the caller'spush), soproduction-deployskips on the inline path and the hotfix never ships.Fix
After creating the branch, surgically
sed-rewrite the gate (andDEPLOY_TAG) to key oninputs.tag_name. Surgical only — deliberately not copying the whole file from the default branch, whose deploy steps have diverged from older tags' code (renamedrefresh-materialized-viewsCLI, pg_cron, Secret Manager fetch) and would break the deploy. Idempotent: skips cleanly when the gate is already current.Committed as
ci:so it doesn't cut a standalone release-please release.🤖 Generated with Claude Code