Renovate Update Patch & Minor Updates #14
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: Pull Request Workflow | |
| permissions: | |
| id-token: write | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| terraform_checks: | |
| name: Validate & Plan ${{ matrix.environment }} | |
| runs-on: "ubuntu-latest" | |
| env: | |
| TF_VAR_pagerduty_token: ${{ secrets.PAGERDUTY_TOKEN }} | |
| TF_VAR_default_role: ${{ matrix.default_role }} | |
| TF_WORKSPACE: ${{ matrix.environment }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - environment: "development" | |
| default_role: ${{ vars.DEVELOPMENT_ROLE }} | |
| - environment: "preproduction" | |
| default_role: ${{ vars.PREPRODUCTION_PULL_REQUEST_ROLE }} | |
| - environment: "production" | |
| default_role: ${{ vars.PRODUCTION_PULL_REQUEST_ROLE }} | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: "Set terraform version [${{ matrix.environment }}]" | |
| id: set-terraform-version | |
| uses: ministryofjustice/opg-github-actions/actions/terraform-version@ceeda9d30ec7f6705c819d0b7664b9a79df99a3b # v.4.8.0 | |
| with: | |
| terraform_directory: ./infrastructure/terraform | |
| - uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2 | |
| with: | |
| terraform_version: ${{ steps.set-terraform-version.outputs.version }} | |
| - name: Configure AWS Credentials For Terraform | |
| uses: aws-actions/configure-aws-credentials@d979d5b3a71173a29b74b5b88418bfda9437d885 # v6.1.1 | |
| with: | |
| aws-region: eu-west-1 | |
| role-to-assume: ${{ vars.OIDC_PULL_REQUEST_ROLE }} | |
| role-session-name: OPGDataGitHubAction | |
| - name: Terraform init | |
| working-directory: ./infrastructure/terraform | |
| run: terraform init | |
| - name: Terraform formatting | |
| working-directory: ./infrastructure/terraform | |
| run: terraform fmt -diff -check -recursive | |
| - name: Terraform validate | |
| working-directory: ./infrastructure/terraform | |
| run: terraform validate | |
| - name: Terraform Plan | |
| working-directory: ./infrastructure/terraform | |
| run: terraform plan -input=false |