Skip to content

Plan summary step fails when a plan changes only outputs #33

Description

@gsavage

Problem

The Plan summary step in .github/workflows/base.yml extracts a one-line summary from the saved
plan with:

line=$(grep -E 'No changes\.|Plan: ' /tmp/<env>.plan.txt)

GitHub Actions runs run: blocks under bash -e, so when grep matches nothing it exits 1 and
takes the whole step (and job) down.

A Terraform plan that changes only outputs prints neither Plan: nor No changes. — it prints
Changes to Outputs: — so any change that adds or edits outputs without touching resources fails
the plan workflow.

Seen in capture-managed:
https://github.com/kosli-dev/capture-managed/actions/runs/33159178074/job/98809231312

Proposed fix

Tolerate a non-matching grep and fall back to the Changes to Outputs: header, then to a generic
message, so the summary degrades gracefully instead of failing the run. has_changes is unaffected:
an outputs-only plan has no No changes. line, so it correctly reports true and the apply job
still runs.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions