A javascript GitHub Action to format a Terraform configuration, and post a code review on the pull request highlighting issues.
The action will initialise the Terraform working directory by default. This can
be disabled with the init parameter.
A summary will be posted with details of any validation errors.
Description: Path to the cli binary to use for executing commands. By default
the action will look for the binary using the TOFU_CLI_PATH and
TERRAFORM_CLI_PATH variables.
Description: The GitHub token to use for interacting with the repostiory
Required : false
Description: Run terraform init before validating
Default: "true"
Description: Recursively check the formating
Default: "false"
Description: Create a code review on the Pull Request
Default: "false"
No outputs are returned.
Check formatting and fail if it needs to be updated.
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
- name: Format Configuration
uses: tf-actions/format@v1Check formatting and create a code review with the required updates.
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
- name: Format Configuration
uses: tf-actions/format@v1
with:
create-review: true
token: ${{ secrets.GITHUB_TOKEN }}