Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
search

GitHub Action

Terraform Pull Request Report Generator

v1.1.0

Terraform Pull Request Report Generator

search

Terraform Pull Request Report Generator

Updates Pull Requests with visual diff of Terraform Plan changes

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Terraform Pull Request Report Generator

uses: ahmadnassri/[email protected]

Learn more about this action in ahmadnassri/action-terraform-report

Choose a version

GitHub Action: Terraform Pull Request Report Generator

license version super linter release

Updates Pull Requests with visual diff of Terraform Plan changes

Usage

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

Inputs

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