From b7d4e060f10c83c2b6f0d58e50dcd40d003850bd Mon Sep 17 00:00:00 2001 From: PePe Amengual <2208324+jamengual@users.noreply.github.com> Date: Thu, 25 Dec 2025 13:56:49 -0800 Subject: [PATCH 1/8] feat: Add has-changes output to expose plan change detection Exposes the existing internal change detection as a new action output, allowing workflows to easily check if the Terraform plan contains changes. --- action.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/action.yml b/action.yml index ee19dba7..7583f144 100644 --- a/action.yml +++ b/action.yml @@ -85,6 +85,9 @@ outputs: plan_json: description: "Path to the terraform plan in JSON format" value: "${{ steps.results.outputs.plan_file_json }}" + has-changes: + description: "Whether the plan has changes. Value is string 'true' or 'false'" + value: "${{ steps.atmos-plan.outputs.changes }}" runs: using: "composite" From fa316ba3a120e3ef44ede2889e8b4270a7505a81 Mon Sep 17 00:00:00 2001 From: PePe Amengual <2208324+jamengual@users.noreply.github.com> Date: Mon, 12 Jan 2026 14:30:31 -0800 Subject: [PATCH 2/8] fix: Remove extra whitespace from drift test expected value The test was failing because the expected string in the contains assertion had extra blank lines and whitespace-only lines that the Go templates don't actually produce. Simplified the expected value to match actual template output. --- .github/workflows/test-failed-plan-drift.yml | 34 +++++--------------- 1 file changed, 8 insertions(+), 26 deletions(-) diff --git a/.github/workflows/test-failed-plan-drift.yml b/.github/workflows/test-failed-plan-drift.yml index 6ea92583..138eb8a9 100644 --- a/.github/workflows/test-failed-plan-drift.yml +++ b/.github/workflows/test-failed-plan-drift.yml @@ -51,9 +51,9 @@ jobs: for file in ./tests/terraform/stacks/catalog/*.yaml; do if [ -f "$file" ]; then sed -i -e "s#__INFRACOST_ENABLED__#false#g" "$file" - sed -i -e "s#__STORAGE_REGION__#${{ env.AWS_REGION }}#g" "$file" + sed -i -e "s#__STORAGE_REGION__#${{ env.AWS_REGION }}#g" "$file" sed -i -e "s#__STORAGE_BUCKET__#${{ secrets.TERRAFORM_STATE_BUCKET }}#g" "$file" - sed -i -e "s#__STORAGE_TABLE__#${{ secrets.TERRAFORM_STATE_TABLE }}#g" "$file" + sed -i -e "s#__STORAGE_TABLE__#${{ secrets.TERRAFORM_STATE_TABLE }}#g" "$file" sed -i -e "s#__STORAGE_TABLE__#${{ secrets.TERRAFORM_STATE_TABLE }}#g" "$file" sed -i -e "s#__STORAGE_ROLE__#${{ secrets.TERRAFORM_STATE_ROLE }}#g" "$file" sed -i -e "s#__PLAN_ROLE__#${{ secrets.TERRAFORM_PLAN_ROLE }}#g" "$file" @@ -97,7 +97,7 @@ jobs: id: metadata run: | set +e - + test -d ./metadata DIR_EXISTS=$? echo "dir_exists=${DIR_EXISTS}" >> $GITHUB_OUTPUT @@ -109,10 +109,10 @@ jobs: test -f ./metadata/issue-description-plat-ue2-sandbox-foobar-fail.md FILE_EXISTS=$? echo "file_md_exists=${FILE_EXISTS}" >> $GITHUB_OUTPUT - + echo "file_md=$(cat ./metadata/issue-description-plat-ue2-sandbox-foobar-fail.md | jq -Rs .)" >> $GITHUB_OUTPUT - - echo "file_json=$(cat ./metadata/plat-ue2-sandbox-foobar-fail.metadata.json | jq -Rs . )" >> $GITHUB_OUTPUT + + echo "file_json=$(cat ./metadata/plat-ue2-sandbox-foobar-fail.metadata.json | jq -Rs . )" >> $GITHUB_OUTPUT - uses: nick-fields/assert-action@v2 with: @@ -142,27 +142,19 @@ jobs: - uses: nick-fields/assert-action@v2 with: - comparison: contains + comparison: contains actual: | ${{ fromJSON(needs.test.outputs.summary) }} expected: | - ## Drift Detection Failed for `foobar-fail` in `plat-ue2-sandbox`! - - - [![failed](https://shields.io/badge/PLAN-FAILED-ff0000?style=for-the-badge)](#user-content-result-plat-ue2-sandbox-foobar-fail) - - - -
:warning: Error summary -
+
To reproduce this locally, run:

```shell @@ -190,18 +182,8 @@ jobs: **Error:** subcommand exited with code 1 ``` - - - -
- - - - - -
Metadata ```json From c142af380cd7a70ce0200873e585633bfd8f335f Mon Sep 17 00:00:00 2001 From: PePe Amengual <2208324+jamengual@users.noreply.github.com> Date: Tue, 13 Jan 2026 15:26:47 -0800 Subject: [PATCH 3/8] chore: trigger CI From 9e5fbdc81c999043aebca23dc5f50e639a543ce7 Mon Sep 17 00:00:00 2001 From: PePe Amengual <2208324+jamengual@users.noreply.github.com> Date: Tue, 13 Jan 2026 15:38:34 -0800 Subject: [PATCH 4/8] fix: Add trailing spaces after br tags to match template output --- .github/workflows/test-failed-plan-drift.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-failed-plan-drift.yml b/.github/workflows/test-failed-plan-drift.yml index 138eb8a9..9f1b563b 100644 --- a/.github/workflows/test-failed-plan-drift.yml +++ b/.github/workflows/test-failed-plan-drift.yml @@ -154,8 +154,8 @@ jobs:
:warning: Error summary -
- To reproduce this locally, run:

+
+ To reproduce this locally, run:

```shell atmos terraform plan foobar-fail -s plat-ue2-sandbox From 75351d7734abbd0883e7fabb62a4c9a8565f0ae1 Mon Sep 17 00:00:00 2001 From: PePe Amengual <2208324+jamengual@users.noreply.github.com> Date: Tue, 13 Jan 2026 16:23:04 -0800 Subject: [PATCH 5/8] fix: Remove extra trailing spaces from br tag on second line --- .github/workflows/test-failed-plan-drift.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-failed-plan-drift.yml b/.github/workflows/test-failed-plan-drift.yml index 9f1b563b..ea6b4c22 100644 --- a/.github/workflows/test-failed-plan-drift.yml +++ b/.github/workflows/test-failed-plan-drift.yml @@ -155,7 +155,7 @@ jobs:
:warning: Error summary
- To reproduce this locally, run:

+ To reproduce this locally, run:

```shell atmos terraform plan foobar-fail -s plat-ue2-sandbox From 06ea40630ab6a14676262e35a5e4f9f84316cc04 Mon Sep 17 00:00:00 2001 From: PePe Amengual <2208324+jamengual@users.noreply.github.com> Date: Tue, 13 Jan 2026 16:50:51 -0800 Subject: [PATCH 6/8] fix: Add blank lines to match template output format --- .github/workflows/test-failed-plan-drift.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/test-failed-plan-drift.yml b/.github/workflows/test-failed-plan-drift.yml index ea6b4c22..fee5c3c5 100644 --- a/.github/workflows/test-failed-plan-drift.yml +++ b/.github/workflows/test-failed-plan-drift.yml @@ -148,10 +148,16 @@ jobs: expected: | ## Drift Detection Failed for `foobar-fail` in `plat-ue2-sandbox`! + +
+ [![failed](https://shields.io/badge/PLAN-FAILED-ff0000?style=for-the-badge)](#user-content-result-plat-ue2-sandbox-foobar-fail) + + +
:warning: Error summary
From e371b43bf4c5739e24c64bbef484d0a652b6d7ae Mon Sep 17 00:00:00 2001 From: PePe Amengual <2208324+jamengual@users.noreply.github.com> Date: Tue, 13 Jan 2026 16:53:44 -0800 Subject: [PATCH 7/8] fix: Add another blank line to match template output --- .github/workflows/test-failed-plan-drift.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-failed-plan-drift.yml b/.github/workflows/test-failed-plan-drift.yml index fee5c3c5..fd1934e4 100644 --- a/.github/workflows/test-failed-plan-drift.yml +++ b/.github/workflows/test-failed-plan-drift.yml @@ -158,6 +158,7 @@ jobs: +
:warning: Error summary
From db9fad068a96054999786fe6adbe574c3679c81c Mon Sep 17 00:00:00 2001 From: PePe Amengual <2208324+jamengual@users.noreply.github.com> Date: Tue, 13 Jan 2026 16:57:26 -0800 Subject: [PATCH 8/8] fix: Trim expected to avoid partial plan output mismatch --- .github/workflows/test-failed-plan-drift.yml | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/.github/workflows/test-failed-plan-drift.yml b/.github/workflows/test-failed-plan-drift.yml index fd1934e4..e077dc47 100644 --- a/.github/workflows/test-failed-plan-drift.yml +++ b/.github/workflows/test-failed-plan-drift.yml @@ -184,25 +184,6 @@ jobs: resource in this configuration you must instead obtain this result from an attribute of that resource. - # Error - - **Error:** subcommand exited with code 1 - ``` - -
- -
Metadata - - ```json - { - "component": "foobar-fail", - "stack": "plat-ue2-sandbox", - "componentPath": "tests/terraform/components/terraform/foobar", - "commitSHA": "${{ github.sha }}" - } - ``` -
- teardown: runs-on: ubuntu-latest needs: [assert]