Skip to content

fix workflow

fix workflow #14

name: Deploy Terraform
on:
push:
branches:
- main
jobs:
deploy:
name: Deploy Terraform
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup Terraform
uses: hashicorp/setup-terraform@v1
with:
terraform_version: 1.6.5
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ${{ secrets.AWS_REGION }}
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/github-oidc/github-deployment
- name: Initialize Terraform
run: terraform init -backend-config="bucket=tf-state-${{ secrets.AWS_REGION }}-${{ secrets.AWS_ACCOUNT_ID }}" -backend-config="key=${{ GITHUB_REPOSITORY }}.tfstate" -backend-config="dynamodb_table=tf-state-${{ secrets.AWS_REGION }}-${{ secrets.AWS_ACCOUNT_ID }}"

Check failure on line 33 in .github/workflows/deploy-terraform.yml

View workflow run for this annotation

GitHub Actions / Deploy Terraform

Invalid workflow file

The workflow is not valid. .github/workflows/deploy-terraform.yml (Line: 33, Col: 12): Unrecognized named-value: 'GITHUB_REPOSITORY'. Located at position 1 within expression: GITHUB_REPOSITORY
- name: Plan Terraform
run: terraform plan -out=tfplan
- name: Apply Terraform
run: terraform apply -auto-approve tfplan