From ce3d8d13e7ccf94b2152beaf0ee0d36fc29fcab9 Mon Sep 17 00:00:00 2001 From: Eric Cabrel TIOGO Date: Sat, 3 Aug 2024 16:38:18 +0200 Subject: [PATCH] fix: run plan on change --- .github/workflows/infra-plan.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/infra-plan.yml b/.github/workflows/infra-plan.yml index 9141072..5bdaa9e 100644 --- a/.github/workflows/infra-plan.yml +++ b/.github/workflows/infra-plan.yml @@ -48,7 +48,7 @@ jobs: terraform_version: 1.9.2 - name: Upload Configuration - if: ${{ success() }} + if: ${{ steps.infra-changed.outputs.any_changed == 'true' }} uses: hashicorp/tfc-workflows-github/actions/upload-configuration@v1.0.0 id: plan-upload with: @@ -57,6 +57,7 @@ jobs: speculative: true - name: Create Plan Run + if: ${{ steps.infra-changed.outputs.any_changed == 'true' }} uses: hashicorp/tfc-workflows-github/actions/create-run@v1.0.0 id: plan-run with: @@ -65,12 +66,14 @@ jobs: plan_only: true - name: Get Plan Output + if: ${{ steps.infra-changed.outputs.any_changed == 'true' }} uses: hashicorp/tfc-workflows-github/actions/plan-output@v1.0.0 id: plan-output with: plan: ${{ fromJSON(steps.plan-run.outputs.payload).data.relationships.plan.data.id }} - name: Update Pull Request + if: ${{ steps.infra-changed.outputs.any_changed == 'true' }} uses: actions/github-script@v6 id: plan-comment with: