Skip to content

Commit

Permalink
v1.47.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dflook committed Feb 28, 2025
1 parent 825f2a4 commit 84e7351
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 12 deletions.
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,24 @@ If any files are not correctly formatted a failing GitHub check will be added fo

* `path`

Path containing Terraform files
The path containing Terraform files to check the formatting of.

- Type: string
- Optional
- Default: The action workspace

* `workspace`

Terraform workspace to inspect when discovering the Terraform version to use, if not otherwise specified.
Terraform workspace to inspect when discovering the Terraform version to use, if the version is not otherwise specified.
See [dflook/terraform-version](https://github.com/dflook/terraform-github-actions/tree/main/terraform-version#terraform-version-action) for details.

- Type: string
- Optional
- Default: `default`

* `backend_config`

List of Terraform backend config values, one per line. This is used for discovering the Terraform version to use, if not otherwise specified.
List of Terraform backend config values, one per line. This is used for discovering the Terraform version to use, if the version is not otherwise specified.
See [dflook/terraform-version](https://github.com/dflook/terraform-github-actions/tree/main/terraform-version#terraform-version-action) for details.

```yaml
Expand All @@ -40,7 +41,7 @@ If any files are not correctly formatted a failing GitHub check will be added fo
* `backend_config_file`

List of Terraform backend config files to use, one per line. This is used for discovering the Terraform version to use, if not otherwise specified.
List of Terraform backend config files to use, one per line. This is used for discovering the Terraform version to use, if the version is not otherwise specified.
See [dflook/terraform-version](https://github.com/dflook/terraform-github-actions/tree/main/terraform-version#terraform-version-action) for details.
Paths should be relative to the GitHub Actions workspace

Expand All @@ -60,6 +61,8 @@ If any files are not correctly formatted a failing GitHub check will be added fo
If the job fails for any other reason this will not be set.
This can be used with the Actions expression syntax to conditionally run a step when the format check fails.

- Type: string

## Environment Variables

* `GITHUB_DOT_COM_TOKEN`
Expand Down
30 changes: 22 additions & 8 deletions action.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,42 @@
name: terraform-fmt-check
description: Check that Terraform configuration files are in canonical format
description: Check that OpenTofu configuration files are in canonical format
author: Daniel Flook

inputs:
path:
description: Path to the Terraform configuration
description: The path containing Terraform files to check the formatting of.
required: false
default: .
default: "."
workspace:
description: Name of the Terraform workspace
description: |
Terraform workspace to inspect when discovering the Terraform version to use, if the version is not otherwise specified.
See [dflook/terraform-version](https://github.com/dflook/terraform-github-actions/tree/main/terraform-version#terraform-version-action) for details.
required: false
default: default
default: "default"
backend_config:
description: List of backend config values to set, one per line
description: |
List of Terraform backend config values, one per line. This is used for discovering the Terraform version to use, if the version is not otherwise specified.
See [dflook/terraform-version](https://github.com/dflook/terraform-github-actions/tree/main/terraform-version#terraform-version-action) for details.
required: false
default: ""
backend_config_file:
description: Path to a backend config file
description: |
List of Terraform backend config files to use, one per line. This is used for discovering the Terraform version to use, if the version is not otherwise specified.
See [dflook/terraform-version](https://github.com/dflook/terraform-github-actions/tree/main/terraform-version#terraform-version-action) for details.
Paths should be relative to the GitHub Actions workspace
required: false
default: ""

outputs:
failure-reason:
description: |
When the job outcome is `failure` because the format check failed, this will be set to 'check-failed'.
If the job fails for any other reason this will not be set.
This can be used with the Actions expression syntax to conditionally run a step when the format check fails.
runs:
using: docker
image: docker://danielflook/terraform-github-actions@sha256:43139c747c6d59c3f83bda22afaff9e331fc959ae1e12769fe1b872ecbd8cdd4
image: docker://danielflook/terraform-github-actions@sha256:7aef5fd3c9c6b005c5fe0a77b3065e5a2eeed4650993041a54c25013761237f7
entrypoint: /entrypoints/fmt-check.sh

branding:
Expand Down

0 comments on commit 84e7351

Please sign in to comment.