Plan examples/tags #70
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: Plan examples/tags | |
| on: | |
| workflow_dispatch: | |
| push: | |
| paths: | |
| - "**/*.tf" | |
| - ".github/workflows/plan-examples-tags.yml" | |
| branches: | |
| - "**" | |
| env: | |
| TF_VAR_terraform_state_bucket: ${{ secrets.TERRAFORM_STATE_BUCKET }} | |
| permissions: | |
| contents: read | |
| jobs: | |
| terraform_validate: | |
| name: Terraform validate | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| contents: read | |
| checks: write | |
| steps: | |
| - name: Harden the runner (Audit all outbound calls) | |
| uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 | |
| with: | |
| egress-policy: audit | |
| - name: Terraform setup | |
| uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2 | |
| with: | |
| terraform_version: 1.12.1 | |
| - name: Checkout repository | |
| uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 | |
| - name: terraform fmt -check -recursive | |
| run: terraform fmt -check -recursive | |
| - name: terraform init -backend=false | |
| working-directory: ./examples/tags | |
| run: terraform init -backend=false | |
| - name: terraform validate | |
| working-directory: ./examples/tags | |
| run: terraform validate | |
| terraform_plan: | |
| name: Terraform plan | |
| runs-on: ubuntu-latest | |
| needs: terraform_validate | |
| defaults: | |
| run: | |
| working-directory: ./examples/tags | |
| permissions: | |
| id-token: write | |
| contents: read | |
| pull-requests: read | |
| checks: write | |
| steps: | |
| - name: Harden the runner (Audit all outbound calls) | |
| uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 | |
| with: | |
| egress-policy: audit | |
| - name: Terraform setup | |
| uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2 | |
| with: | |
| terraform_version: 1.12.1 | |
| - name: Checkout repository | |
| uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 | |
| - name: Configure AWS credentials | |
| uses: aws-actions/configure-aws-credentials@00943011d9042930efac3dcd3a170e4273319bc8 # v5.1.0 | |
| with: | |
| role-to-assume: ${{ secrets.AWS_DEPLOY_ROLE_ARN}} | |
| aws-region: ${{ secrets.AWS_REGION }} | |
| - name: terraform init | |
| run: > | |
| terraform init | |
| -backend-config=bucket=${{ secrets.TERRAFORM_STATE_BUCKET}} | |
| -backend-config=key=${{ secrets.TERRAFORM_STATE_KEY}} | |
| -backend-config=region=${{ secrets.TERRAFORM_STATE_REGION}} | |
| - name: terraform plan | |
| run: terraform plan -out tfplan |