Skip to content

Keep the plan summary working for outputs-only plans - #34

Merged
gsavage merged 1 commit into
mainfrom
plan-summary-outputs-only
Aug 28, 2026
Merged

Keep the plan summary working for outputs-only plans#34
gsavage merged 1 commit into
mainfrom
plan-summary-outputs-only

Conversation

@gsavage

@gsavage gsavage commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Addresses #33

Problem

The Plan summary step in .github/workflows/base.yml grepped the saved plan for No changes. or
Plan: and assigned the match to a variable. GitHub Actions runs run: blocks under bash -e, so
when neither pattern was present grep exited 1 and failed the whole job.

Terraform prints neither of those lines when a plan changes only outputs — it prints
Changes to Outputs: — so any change that adds or edits an output without touching resources broke
the plan workflow for callers, as seen in
capture-managed.

Change

Tolerate a non-matching grep, falling back to the Changes to Outputs: header and then to a generic
message pointing at the uploaded plan. The plan path is hoisted into a variable so the later
grep -q shares it.

has_changes is unchanged in meaning: an outputs-only plan has no No changes. line, so it still
reports true and the apply job still runs.

Testing

Ran the patched block under bash -e against four sample plan files:

plan content summary has_changes
Changes to Outputs: only Changes to Outputs: true
No changes. Your infrastructure matches… that line false
Plan: 1 to add, 0 to change, 0 to destroy. that line true
unrecognised output See the uploaded plan for details. true

No case exits non-zero. The workflow file still parses as YAML.

The Apply summary step has the same shape, but Apply complete! is printed on every successful
apply, so it is left alone.

The "Plan summary" step grepped the saved plan for "No changes." or
"Plan: " and assigned the match to a variable. GitHub Actions runs
`run:` blocks under `bash -e`, so when neither pattern was present grep
exited 1 and failed the whole job.

Terraform prints neither of those lines when a plan changes only
outputs; it prints "Changes to Outputs:" instead. Any change that adds
or edits an output without touching resources therefore broke the plan
workflow for callers.

Tolerate a non-matching grep and fall back to the outputs header, then
to a generic message pointing at the uploaded plan. has_changes is
unchanged in meaning: an outputs-only plan has no "No changes." line, so
it still reports true and the apply job still runs.
@gsavage
gsavage disabled auto-merge August 28, 2026 10:05
@gsavage
gsavage merged commit ab864d3 into main Aug 28, 2026
1 check passed
@gsavage
gsavage deleted the plan-summary-outputs-only branch August 28, 2026 10:05
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