Skip to content

Commit 5603d2d

Browse files
committed
ci: Update tflint and trivy workflows.
1 parent 03a0a3c commit 5603d2d

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

.github/workflows/tflint.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ permissions:
1313
jobs:
1414
lint:
1515
runs-on: ubuntu-latest
16+
env:
17+
# Required to avoid rate limiting when downloading plugins.
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1619
steps:
1720
- name: Checkout source code
1821
uses: actions/checkout@v6
@@ -43,9 +46,8 @@ jobs:
4346
with:
4447
annotation-level: notice
4548
sarif-file: tflint-results.sarif
46-
# When run on main, upload the SARIF file to GitHub.
4749
- name: Upload SARIF result
48-
if: always() && github.ref == 'refs/heads/main'
50+
if: always()
4951
uses: github/codeql-action/upload-sarif@v4
5052
with:
5153
sarif_file: tflint-results.sarif

.github/workflows/trivy.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: Trivy Analysis
22

33
on:
44
push:
5+
pull_request:
6+
branches:
7+
- main
58

69
permissions:
710
contents: read
@@ -16,21 +19,18 @@ jobs:
1619
- name: Run Trivy vulnerability scanner
1720
uses: aquasecurity/[email protected]
1821
with:
19-
scan-type: config
20-
ignore-unfixed: true
21-
skip-dirs: "**/*/.terraform"
22-
exit-code: 1
2322
format: sarif
2423
output: trivy-results.sarif
24+
scan-type: config
25+
trivy-config: trivy.yaml
2526
- name: Parse SARIF file for annotations
2627
if: always()
2728
uses: jontyms/[email protected]
2829
with:
2930
annotation-level: notice
3031
sarif-file: trivy-results.sarif
31-
# When run on main, upload the SARIF file to GitHub.
3232
- name: Upload SARIF result
33-
if: always() && github.ref == 'refs/heads/main'
33+
if: always()
3434
uses: github/codeql-action/upload-sarif@v4
3535
with:
3636
sarif_file: trivy-results.sarif

0 commit comments

Comments
 (0)