I am trying to automate the test cases for one of our module and wanted to run terraform plan in ./examples folder whereas it is getting executed in root and breaking with the error attached as it is waiting for the inputs. How can i mention the correct path in below yaml to run terraform plan in ./examples instead of root directory. Thanks.
Code: Terraform.yaml
name: Terraform
on:
pull_request:
branches:
- master
jobs:
terraform:
name: ‘Terraform’
runs-on: ubuntu-latest
env:
tf_actions_working_dir: ‘./examples’
tf-version: ‘0.13.0’
aws-region: ‘us-east-1’
steps:
- uses: actions/checkout@v2
- name: Setup Terraform
uses: hashicorp/setup-terraform@v1
with:
terraform_wrapper: false
- name: 'Terraform Format'
id: fmt
run: terraform fmt
continue-on-error: true
env:
AWS_DEFAULT_REGION: ${{ env.aws-region }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Terraform Init
id: init
run: terraform init
env:
AWS_DEFAULT_REGION: ${{ env.aws-region }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Terraform Validate
id: validate
run: terraform validate -no-color
env:
AWS_DEFAULT_REGION: ${{ env.aws-region }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Terraform Plan
id: plan
run: terraform plan -no-color
env:
AWS_ACCESS_KEY_ID: ${{ secrets.TESTING_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.TESTING_AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ env.aws-region }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}