Skip to content

ci: deploy production inline from release-please (fix missing release tag trigger)#708

Merged
jirhiker merged 3 commits into
stagingfrom
fix/release-please-triggers-prod-deploy
Jun 8, 2026
Merged

ci: deploy production inline from release-please (fix missing release tag trigger)#708
jirhiker merged 3 commits into
stagingfrom
fix/release-please-triggers-prod-deploy

Conversation

@jirhiker

@jirhiker jirhiker commented Jun 8, 2026

Copy link
Copy Markdown
Member

Why

After merging staging → production, release-please opens its release PR and (on merge) creates the GitHub release + tag — but CD (Production) never runs.

Root cause: release-please creates the release/tag with the default GITHUB_TOKEN. GitHub deliberately does not emit workflow-triggering events for actions taken with GITHUB_TOKEN (recursive-trigger protection). So the release: published event never reaches CD (Production), and nothing deploys.

How

Run the deploy as a job in the same workflow run as release-please, which sidesteps the cascade restriction — no PAT needed.

  • CD_production.yml: now a reusable workflow.
    • Add workflow_call trigger with a tag_name input.
    • Resolve the deploy tag via a job-level DEPLOY_TAG = inputs.tag_name || github.event.release.tag_name, used by the validate step, the refs/tags/… checkout, and APP_VERSION.
    • Keep the version-shape guard (if: + regex step).
    • Retain release: published as a fallback for releases published via the UI or a PAT.
  • release-please.yml: expose release_created / tag_name outputs and add a deploy-production job that uses: ./.github/workflows/CD_production.yml with secrets: inherit, gated on release_created == 'true'.

Flow after this

  1. Merge staging → production → release-please opens release PR.
  2. Merge release PR → push to production → release-please creates release+tag and the deploy-production job deploys it in the same run.

Notes

  • No double-deploy: when release-please makes the release (GITHUB_TOKEN), release: published does not fire; only the inline call deploys. A manual UI/PAT release fires the fallback path instead.
  • production environment protection rules still apply to the called job.
  • YAML validated locally.

…gger)

release-please creates the GitHub release + tag using the default
GITHUB_TOKEN. GitHub does not emit workflow-triggering events for
actions taken with GITHUB_TOKEN (recursive-trigger block), so the
`release: published` event never reached CD (Production) and nothing
deployed after a release PR merged.

Make CD (Production) a reusable workflow (workflow_call) accepting a
tag_name input, and have release-please invoke it inline when it
reports release_created == true. Running the deploy as a job in the
same workflow run sidesteps the GITHUB_TOKEN cascade restriction
entirely — no PAT required.

- CD_production: add workflow_call trigger; resolve the deploy tag from
  inputs.tag_name (call) or github.event.release.tag_name (event) via a
  job-level DEPLOY_TAG env; keep the version-shape guard and the
  refs/tags checkout. The `release: published` trigger is retained as a
  fallback for releases published via the UI or a PAT.
- release-please: expose release_created/tag_name outputs and add a
  deploy-production job (uses: ./.github/workflows/CD_production.yml,
  secrets: inherit) gated on release_created.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 8, 2026 19:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes production deployments not triggering after a release-please merge by running the production deploy inline within the same release-please workflow run (avoiding GitHub’s event suppression for actions performed with GITHUB_TOKEN).

Changes:

  • Expose release_created and tag_name from the release-please job and conditionally invoke production deployment via a reusable workflow.
  • Convert CD_production.yml into a reusable workflow (workflow_call) that accepts a tag_name input while keeping release: published as a fallback trigger.
  • Standardize production deploy tag resolution via a DEPLOY_TAG env var used for validation, checkout ref, and APP_VERSION.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
.github/workflows/release-please.yml Adds job outputs and a gated deploy-production reusable-workflow call after a release is created.
.github/workflows/CD_production.yml Adds workflow_call support and routes deployment to a resolved DEPLOY_TAG used throughout the job.

Comment thread .github/workflows/CD_production.yml Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 8, 2026 19:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread .github/workflows/release-please.yml
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 8, 2026 19:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@jirhiker jirhiker merged commit f17d81c into staging Jun 8, 2026
10 checks passed
@jirhiker jirhiker deleted the fix/release-please-triggers-prod-deploy branch June 8, 2026 19:51
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