chore(aws/modules/baseline): bump hashicorp/aws from 5.100.0 to 6.42.0 in /providers/aws/modules/baseline #16
Workflow file for this run
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
| name: Terraform Plan | |
| on: | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - 'providers/**' | |
| - 'Makefile' | |
| - 'scripts/**' | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'providers/**' | |
| - 'Makefile' | |
| - 'scripts/**' | |
| jobs: | |
| plan: | |
| name: Terraform Plan | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| pull-requests: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Terraform | |
| uses: hashicorp/setup-terraform@v3 | |
| with: | |
| terraform_version: "~1.5" | |
| - name: Authenticate to GCP | |
| uses: google-github-actions/auth@v2 | |
| with: | |
| workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }} | |
| service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }} | |
| - name: Terraform Plan | |
| id: plan | |
| run: | | |
| set +e | |
| make ci-plan CMD=plan 2>&1 | tee plan_output.txt | |
| PLAN_EXIT=${PIPESTATUS[0]} | |
| set -e | |
| echo "exit_code=$PLAN_EXIT" >> "$GITHUB_OUTPUT" | |
| { | |
| echo "plan_output<<EOF" | |
| cat plan_output.txt | |
| echo "EOF" | |
| } >> "$GITHUB_OUTPUT" | |
| # Exit 2 = changes detected (not an error for plan workflow) | |
| [[ $PLAN_EXIT -eq 1 ]] && exit 1 || exit 0 | |
| - name: Post Plan Comment | |
| if: github.event_name == 'pull_request' | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const exitCode = '${{ steps.plan.outputs.exit_code }}'; | |
| const planOutput = `${{ steps.plan.outputs.plan_output }}`.trim(); | |
| const status = exitCode === '0' ? '✅ No changes' : | |
| exitCode === '2' ? '⚠️ Changes detected' : '❌ Error'; | |
| const maxLength = 60000; | |
| const truncated = planOutput.length > maxLength | |
| ? planOutput.substring(0, maxLength) + '\n\n... output truncated (exceeded 60,000 chars)' | |
| : planOutput; | |
| const body = [ | |
| `### ${status}: Terraform Plan`, | |
| '', | |
| '<details><summary>Show plan output</summary>', | |
| '', | |
| '```', | |
| truncated, | |
| '```', | |
| '', | |
| '</details>' | |
| ].join('\n'); | |
| github.rest.issues.createComment({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body | |
| }); |