Fix: Use the correct variables. #23
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: TFLint Checks | |
| on: | |
| push: | |
| pull_request: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| security-events: write | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| env: | |
| # Required to avoid rate limiting when downloading plugins. | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| steps: | |
| - name: Checkout source code | |
| uses: actions/checkout@v6 | |
| - name: Cache plugin directory | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.tflint.d/plugins | |
| key: tflint-${{ hashFiles('.tflint.hcl') }} | |
| - uses: terraform-linters/setup-tflint@v6 | |
| name: Setup TFLint | |
| - name: Show version | |
| run: tflint --version | |
| - name: Init TFLint | |
| run: tflint --init | |
| - name: Run TFLint | |
| # Run TFLint, outputting the results to a SARIF file. We use `tee` so | |
| # that we can still see the output in the logs, and capture the exit | |
| # code properly with `pipefail`. | |
| run: | | |
| set -o pipefail | |
| tflint --format sarif --recursive \ | |
| --config "$GITHUB_WORKSPACE/.tflint.hcl" \ | |
| | tee tflint-results.sarif | |
| exit "${PIPESTATUS[0]}" | |
| - name: Parse SARIF file for annotations | |
| if: always() | |
| uses: jontyms/sarif-annotations@v0.0.3 | |
| with: | |
| annotation-level: notice | |
| sarif-file: tflint-results.sarif | |
| - name: Upload SARIF result | |
| if: always() | |
| uses: github/codeql-action/upload-sarif@v4 | |
| with: | |
| sarif_file: tflint-results.sarif |