Skip to content

chore(gcp/modules/baseline): bump hashicorp/google from 5.45.2 to 7.35.0 in /providers/gcp/modules/baseline #87

chore(gcp/modules/baseline): bump hashicorp/google from 5.45.2 to 7.35.0 in /providers/gcp/modules/baseline

chore(gcp/modules/baseline): bump hashicorp/google from 5.45.2 to 7.35.0 in /providers/gcp/modules/baseline #87

Workflow file for this run

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
});