Skip to content

✨New Terraform Directory and Auth0 Integration #6

✨New Terraform Directory and Auth0 Integration

✨New Terraform Directory and Auth0 Integration #6

name: "Auth0 Terraform Plan"
on:
workflow_dispatch:
pull_request:
paths:
- "terraform/auth0/**"
branches:
- main
env:
TERRAFORM_VERSION: "1.6.6"
jobs:
terraform:
name: "Auth0 Terraform Plan"
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
id-token: write
strategy:
matrix:
path:
- "operations-engineering-test"
defaults:
run:
working-directory: "terraform/auth0/${{ matrix.path }}"
steps:
- uses: actions/checkout@v4
- uses: hashicorp/setup-terraform@v3
with:
terraform_version: ${{ env.TERRAFORM_VERSION }}
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.TERRAFORM_AUTH0_S3_ROLE_ARN_DEV}}
aws-region: eu-west-2
- name: Terraform fmt
id: fmt
run: terraform fmt -check -diff -recursive ./terraform
continue-on-error: true
- name: Terraform Init
id: init
run: terraform init -input=false -no-color
- name: Terraform Validate
id: validate
run: terraform validate -input=false -no-color
# When I get secrets manager working in github actions, we can uncomment the below.
# - name: Terraform Plan
# id: plan
# working-directory: terraform/${{ matrix.path }}
# run: terraform plan -input=false -no-color
# continue-on-error: true
# - name: Post Plan to GitHub PR
# uses: mshick/add-pr-comment@v1
# with:
# allow-repeats: true
# repo-token: ${{ secrets.GITHUB_TOKEN }}
# repo-token-user-login: 'github-actions[bot]'
# message: |
# ## ${{ matrix.path }} plan
# ```
# ${{ steps.plan.outputs.stdout || steps.plan.outputs.stderr }}
# ```