Skip to content

Automate Service Provisioning with Terraform #2

Automate Service Provisioning with Terraform

Automate Service Provisioning with Terraform #2

name: Automate Service Provisioning with Terraform
on:
push:
branches:
- rk/infra-automation
paths:
- 'infrastructure/terraform'
workflow_dispatch:
env:
WORKSPACE: ${{ GITHUB_REF_NAME }}

Check failure on line 12 in .github/workflows/terraform-pipeline.yml

View workflow run for this annotation

GitHub Actions / Automate Service Provisioning with Terraform

Invalid workflow file

The workflow is not valid. .github/workflows/terraform-pipeline.yml (Line: 12, Col: 14): Unrecognized named-value: 'GITHUB_REF_NAME'. Located at position 1 within expression: GITHUB_REF_NAME
REPOSITORY: ${{ github.repository }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set TF Backend
shell: bash
run: echo "terraform backend"
- name: Initialize Terraform
shell: bash
run: echo "terraform init"
- name: Set Terraform Workspace
shell: bash
run: echo "terraform workspace select ${{ env.WORKSPACE }}"
- name: Plan Terraform
shell: bash
run: echo "terraform plan -out tfplan"
- name: Approval Gate to Apply Terraform
shell: bash
run: echo "terraform approval gate"
- name: Apply Terraform
shell: bash
run: echo "terraform apply tfplan"