Git Product home page Git Product logo

action-terraform-report's Introduction

GitHub Action: Terraform Pull Request Report Generator

Updates Pull Requests with visual diff of Terraform Plan changes

license release semantic

Usage

name: terraform-plan

on:
  pull_request:

jobs:
  terraform-plan:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2
      - uses: hashicorp/setup-terraform@v1
        with:
          terraform_wrapper: false

      - run: terraform init
      - run: terraform plan -lock=false -out terraform.plan

      # generate plain output
      - run: terraform show -no-color terraform.plan > terraform.text

      # generate json output
      - run: terraform show -json terraform.plan > terraform.json

      - uses: ahmadnassri/action-terraform-report@v3
        with:
          # tell the action the plan outputs
          terraform-text: ${{ github.workspace }}/terraform.text
          terraform-json: ${{ github.workspace }}/terraform.json
          remove-stale-reports: true

Note: Ensure terraform_wrapper is set to false to better capture the output into a file (or use your own method)

Inputs

input required default description
terraform-text - path to the file resulting from the output of terraform show /path/to/plan
terraform-json - path to the file resulting from the output of terraform show -json /path/to/plan
github-token github.token The GitHub token used to post comments on pull requests
show-plan true include the terraform plan view in the final output?
show-diff false include the diff view in the final output?
remove-stale-reports false remove report comments for old commits?

Examples

Pull Request Comment (default)
Pull Request Comment (Plan)
Pull Request Comment (Diff)

Author: Ahmad Nassri • Twitter: @AhmadNassri

action-terraform-report's People

Contributors

dependabot[bot] avatar x4b1 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.