Skip to content

Commit c426a2f

Browse files
committed
ci: Add dedicated TFLint workflow.
1 parent 807d957 commit c426a2f

File tree

2 files changed

+16
-69
lines changed

2 files changed

+16
-69
lines changed

.github/workflows/branch.yaml

Lines changed: 0 additions & 61 deletions
This file was deleted.
Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
name: Main Checks
1+
name: TFLint Checks
22

33
on:
44
push:
5+
pull_request:
56
branches:
67
- main
78

89
permissions:
910
contents: read
10-
security-events: write
1111

1212
jobs:
1313
lint:
1414
runs-on: ubuntu-latest
15-
env:
16-
# Required to avoid rate limiting when downloading plugins.
17-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1815
steps:
1916
- name: Checkout source code
2017
uses: actions/checkout@v4
21-
- uses: actions/cache@v4
22-
name: Cache plugin directory
18+
- name: Check security features
19+
id: security-features
20+
uses: ./.github/actions/security-features
21+
- name: Cache plugin directory
22+
uses: actions/cache@v4
2323
with:
2424
path: ~/.tflint.d/plugins
2525
key: tflint-${{ hashFiles('.tflint.hcl') }}
@@ -31,8 +31,16 @@ jobs:
3131
run: tflint --init
3232
- name: Run TFLint
3333
run: tflint --format sarif --recursive --config "$GITHUB_WORKSPACE/.tflint.hcl" > tflint-results.sarif
34-
- name: Upload SARIF result
34+
- name: Parse SARIF file for annotations
3535
if: always()
36+
uses: Miragon/[email protected]
37+
with:
38+
severity-level: low
39+
sarif-file: tflint-results.sarif
40+
# When run on main, if SARIF uploads are available, we want to upload the
41+
# SARIF file to GitHub.
42+
- name: Upload SARIF result
43+
if: always() && github.ref == 'refs/heads/main' && steps.security-features.outputs.sarif == 'true'
3644
uses: github/codeql-action/upload-sarif@v3
3745
with:
3846
sarif_file: tflint-results.sarif

0 commit comments

Comments
 (0)