diff --git a/.github/workflows/terraform-validate.yml b/.github/workflows/terraform-validate.yml index fcd32f7..1fae0ad 100644 --- a/.github/workflows/terraform-validate.yml +++ b/.github/workflows/terraform-validate.yml @@ -6,12 +6,18 @@ on: pull_request: branches: - main - push: - branches: - - main - workflow_dispatch: +permissions: + id-token: write + contents: read + issues: write + +env: + ARM_CLIENT_ID: "${{ secrets.AZURE_CLIENT_ID }}" + ARM_SUBSCRIPTION_ID: "${{ secrets.AZURE_SUBSCRIPTION_ID }}" + ARM_TENANT_ID: "${{ secrets.AZURE_TENANT_ID }}" + jobs: terraform_validate: name: "Format and Validate Code" @@ -21,10 +27,8 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Set up Terraform + - name: Setup Terraform uses: hashicorp/setup-terraform@v3 - with: - terraform_version: 1.8.4 - name: Check resource group configuration run: | @@ -109,15 +113,8 @@ jobs: - name: Terraform Fmt run: terraform fmt -check -recursive -diff - - name: Log in to Azure - uses: azure/login@v2 - with: - client-id: ${{ secrets.AZURE_CLIENT_ID }} - tenant-id: ${{ secrets.AZURE_TENANT_ID }} - subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - - name: Terraform Init - run: terraform init + run: terraform init -backend=false - name: Terraform Validate run: terraform validate