Repository navigation
feat!: apply the reviewed plan behind an environment gate - #6
Merged
Merged
Conversation
- terraform-plan: -detailed-exitcode, has_changes output, plan in job summary, optional upload of the saved plan (upload_plan, 1-day retention) - terraform-apply: required `environment` input declared on the apply job (GitHub rejects environment: on a job that calls a reusable workflow); plan_artifact_name applies the exact saved plan; falls back to a fresh plan with a warning when omitted - fix: reference this repo's composite actions at the release tag instead of @main; release-please now bumps them via extra-files - release-please: bump-minor-pre-major so breaking changes stay in 0.x BREAKING CHANGE: terraform-apply requires an `environment` input. Move `environment:` from the calling job into `with:`. Co-Authored-By: Claude Opus 5.5 <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.
Fixes three issues in the Terraform workflows.
1. Internal composite actions were referenced at
@mainterraform-plan.ymlandterraform-apply.ymlcalled this repo's own actions at@main, which contradicts the README's own "avoid@main" guidance: a SHA-pinned caller still pulled unpinned code. They now use the release tag with# x-release-please-version, andrelease-please-config.jsonlists both workflows inextra-filesso each release PR bumps them.2. Apply ran a fresh, unreviewed plan
terraform-applyranapply -auto-approve, so what got applied could differ from what was reviewed. Now:terraform-planuses-detailed-exitcode, exposes ahas_changesoutput, writes the plan to the job summary, and withupload_plan: truesaves the plan file as an artifact (1-day retention, since plan files can contain sensitive values in plaintext).terraform-applydownloads that artifact and runsterraform apply tfplan. If state drifted after the plan, Terraform rejects the stale plan.3. The documented approval gate couldn't work
The README put
environment: prodon the job that calls the reusable workflow. GitHub doesn't supportenvironmenton caller jobs (supported keywords).terraform-applynow takes a requiredenvironmentinput and declares it on the apply job. That also produces therepo:<org>/<repo>:environment:<name>OIDC subject claim that thegithub-oidc-rolemodules trust.Breaking change
environmentis now a required input onterraform-apply.bump-minor-pre-majoris enabled, so this releases as v0.3.0, not 1.0.0.Validation
actionlint1.7.12 (same version as CI): clean🤖 Generated with Claude Code