GitHub Action that lints a Terraform based repository via action-pre-commit
jobs:
build:
steps:
- name: Lint
uses: open-turo/actions-tf/lint@v3
with:
## example value for terraform-cli-credentials-token provided below
terraform-cli-credentials-token: ${{ secrets.TCCT }}
You can specify an S3 bucket to cache dependencies in order to speed up runs, in which case you will need to configure AWS credentials like so:
jobs:
build:
steps:
- uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- uses: open-turo/actions-tf/lint@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
s3-bucket-name: <bucket-name>
s3-bucket-region: us-east-1
IMPORTANT: GITHUB_TOKEN
does not have the required permissions to operate on protected branches.
If you are using this action for protected branches, replace GITHUB_TOKEN
with Personal Access Token.
If using the @semantic-release/git
plugin for protected branches, avoid persisting credentials as part
of actions/checkout@v4
by setting the parameter persist-credentials: false
. This credential does not have the
required permission to operate on protected branches.
parameter | description | required | default |
---|---|---|---|
checkout-repo | Perform checkout as first step of action | false |
true |
terraform-cli-credentials-token | The terraform cli config credentials token | true |
|
terraform-cli-config-file | Relative path to the terraform cli config file | false |
.terraformrc |
This action is a composite
action.