Keep the plan summary working for outputs-only plans - #34
Merged
Conversation
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
enabled auto-merge
August 28, 2026 10:04
sami-alajrami
approved these changes
Aug 28, 2026
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.
Addresses #33
Problem
The
Plan summarystep in.github/workflows/base.ymlgrepped the saved plan forNo changes.orPlan:and assigned the match to a variable. GitHub Actions runsrun:blocks underbash -e, sowhen 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 brokethe 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 genericmessage pointing at the uploaded plan. The plan path is hoisted into a variable so the later
grep -qshares it.has_changesis unchanged in meaning: an outputs-only plan has noNo changes.line, so it stillreports
trueand the apply job still runs.Testing
Ran the patched block under
bash -eagainst four sample plan files:Changes to Outputs:onlyChanges to Outputs:trueNo changes. Your infrastructure matches…falsePlan: 1 to add, 0 to change, 0 to destroy.trueSee the uploaded plan for details.trueNo case exits non-zero. The workflow file still parses as YAML.
The
Apply summarystep has the same shape, butApply complete!is printed on every successfulapply, so it is left alone.