Skip to content

chore: use github action to terraform plan #4

chore: use github action to terraform plan

chore: use github action to terraform plan #4

Workflow file for this run

name: Terraform plan

Check failure on line 1 in .github/workflows/terraform-plan.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/terraform-plan.yml

Invalid workflow file

(Line: 29, Col: 9): Unexpected value 'environment'
# TODO: only run when the contents of terraform/ have changed
on:
workflow_dispatch:
pull_request:
env:
ENV_NAME: "dev"
# Federated Identity credentials
permissions:
id-token: write
contents: read
jobs:
terraform-plan:
runs-on: ubuntu-latest
defaults:
run:
working-directory: infra/terraform
steps:
- name: Check out the repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Log in to azure using federated identity credentials
uses: azure/login@532459ea530d8321f2fb9bb10d1e0bcf23869a43 # v3
environment: $ENV_NAME
with:
client-id: ${{ secrets.AZURE_SP_PR_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_SP_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SP_SUBSCRIPTION_ID }}
- name: Setup terraform
uses: hashicorp/setup-terraform@dfe3c3f87815947d99a8997f908cb6525fc44e9e # v4
with:
terraform_version: 1.14.5
- name: Initialize terraform and select workspace
run: terraform/init.sh $ENV_NAME
- name: Terraform Plan
run: |
cd terraform && \
terraform plan \
-var "CONTAINER_TAG=${{ github.sha }}" \