You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
GitHub Action
Terraform Pull Request Report Generator
v1.1.0
Updates Pull Requests with visual diff of Terraform Plan changes
name: terraform-plan
on:
pull_request:
jobs:
terraform-plan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: hashicorp/setup-terraform@v1
- run: terraform init
- run: terraform validate
- run: terraform plan -lock=false -out terraform.plan
- run: terraform show -json terraform.plan
id: show
# store output into a file
- run: |
cat > terraform.json << 'EOM'
${{ steps.show.outputs.stdout }}
EOM
- uses: ahmadnassri/action-terraform-report@v1
with:
# tell the action where to find the json file
terraform-plan: ${{ github.workspace }}/terraform.json
input | required | default | description |
---|---|---|---|
terraform-plan |
✔ | - |
path to Terraform JSON file generated with terraform show |
github-token |
❌ | github.token |
The GitHub token used to update the pull-request |