Code Monkey home page Code Monkey logo

action-format-hcl's Introduction

GitHub Action for formating HCL files

GitHub Action automatically formatting all HCL and TF files (.hcl, .tf, .tfvars).

Dockerized as devopsinfra/action-format-hcl.

Features:

Badge swag

Master branch Other branches
GitHub repo GitHub code size in bytes GitHub last commit GitHub license
DockerHub Docker version Image size Docker Pulls

Reference

    - name: Fail on malformatted files
      uses: devops-infra/[email protected]
      with:
        list: false
        write: true
        ignore: "config"
        diff: false
        check: false
        recursive: true
        dir: "modules"
Input Variable Required Default Description
list No false List files containing formatting inconsistencies.
write No true Overwrite input files. Disabled if using check.
ignore No "" Comma separated list of paths to ignore. Only for .hcl files.
diff No false Display diffs of formatting changes.
check No false Check if files are malformatted.
recursive No true Also process files in subdirectories.
dir No "" Path to be checked. Current dir as default.

Examples

Action can fail if malformed files will be found.

name: Check HCL
on:
  push
jobs:
  format-hcl:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout
      uses: actions/checkout@v2
    - name: Fail on malformatted files
      uses: devops-infra/[email protected]
      with:
        check: true

Action can automatically format all HCL files and commit updated files back to the repository using my other action action-commit-push.

name: Format HCL
on:
  push
jobs:
  format-hcl:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout
      uses: actions/checkout@v2
    - name: Format HCL files
      uses: devops-infra/[email protected]
    - name: Commit changes to repo
      uses: devops-infra/action-commit-push@master
      with:
        github_token: ${{ secrets.GITHUB_TOKEN }}
        commit_prefix: "[AUTO-FORMAT-HCL]"

action-format-hcl's People

Contributors

christophshyper avatar dependabot[bot] avatar github-actions[bot] avatar

Watchers

 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.