Skip to content

Commit 213737a

Browse files
committed
ci: Update workflows to match current patterns.
1 parent a61b5ef commit 213737a

6 files changed

Lines changed: 95 additions & 123 deletions

File tree

.github/workflows/branch.yaml

Lines changed: 0 additions & 49 deletions
This file was deleted.
Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@ on:
1313
jobs:
1414
analyze:
1515
name: Analyze (${{ matrix.language }})
16-
# Runner size impacts CodeQL analysis time. To learn more, please see:
17-
# - https://gh.io/recommended-hardware-resources-for-running-codeql
18-
# - https://gh.io/supported-runners-and-hardware-resources
19-
# - https://gh.io/using-larger-runners (GitHub.com only)
20-
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
2116
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
2217
permissions:
2318
security-events: write
@@ -28,20 +23,17 @@ jobs:
2823
fail-fast: false
2924
matrix:
3025
include:
31-
# We use javascript to analyze JSON and YAML files.
32-
- language: javascript-typescript
33-
build_mode: none
3426
- language: actions
3527
build_mode: none
3628
steps:
3729
- name: Checkout repository
38-
uses: actions/checkout@v4
30+
uses: actions/checkout@v6
3931
- name: Initialize CodeQL
40-
uses: github/codeql-action/init@v3
32+
uses: github/codeql-action/init@v4
4133
with:
4234
languages: ${{ matrix.language }}
4335
build-mode: ${{ matrix.build-mode }}
4436
- name: Perform CodeQL Analysis
45-
uses: github/codeql-action/analyze@v3
37+
uses: github/codeql-action/analyze@v4
4638
with:
4739
category: "/language:${{matrix.language}}"

.github/workflows/main.yaml

Lines changed: 0 additions & 58 deletions
This file was deleted.

.github/workflows/release.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ jobs:
1818
pull-requests: write
1919
steps:
2020
- name: Checkout source code
21-
uses: actions/checkout@v4
21+
uses: actions/checkout@v6
2222
with:
2323
fetch-depth: 0
2424
- name: Bump version and create changelog
2525
id: bump
26-
uses: commitizen-tools/commitizen-action@master
26+
uses: commitizen-tools/commitizen-action@0.27.0
2727
with:
2828
push: false
2929
github_token: ${{ secrets.GITHUB_TOKEN }}
@@ -34,7 +34,7 @@ jobs:
3434
MESSAGE=$(git log --format=%B -n 1)
3535
echo "message=${MESSAGE}" >> $GITHUB_OUTPUT
3636
- name: Open a pull request for the release
37-
uses: peter-evans/create-pull-request@v7
37+
uses: peter-evans/create-pull-request@v8
3838
with:
3939
branch: release-${{ steps.bump.outputs.version }}
4040
title: ${{ steps.message.outputs.message }}
@@ -48,7 +48,7 @@ jobs:
4848
contents: write
4949
steps:
5050
- name: Checkout source code
51-
uses: actions/checkout@v4
51+
uses: actions/checkout@v6
5252
- name: Get the module name
5353
id: module_name
5454
run: |
@@ -58,7 +58,7 @@ jobs:
5858
echo "name=${MODULE_NAME}" >> $GITHUB_OUTPUT
5959
- name: Get the version from the commit message
6060
id: version
61-
uses: actions/github-script@v7
61+
uses: actions/github-script@v8
6262
env:
6363
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
6464
with:

.github/workflows/tflint.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: TFLint Checks
2+
3+
on:
4+
push:
5+
pull_request:
6+
branches:
7+
- main
8+
9+
permissions:
10+
contents: read
11+
security-events: write
12+
13+
jobs:
14+
lint:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout source code
18+
uses: actions/checkout@v6
19+
- name: Cache plugin directory
20+
uses: actions/cache@v5
21+
with:
22+
path: ~/.tflint.d/plugins
23+
key: tflint-${{ hashFiles('.tflint.hcl') }}
24+
- uses: terraform-linters/setup-tflint@v6
25+
name: Setup TFLint
26+
- name: Show version
27+
run: tflint --version
28+
- name: Init TFLint
29+
run: tflint --init
30+
- name: Run TFLint
31+
# Run TFLint, outputting the results to a SARIF file. We use `tee` so
32+
# that we can still see the output in the logs, and capture the exit
33+
# code properly with `pipefail`.
34+
run: |
35+
set -o pipefail
36+
tflint --format sarif --recursive \
37+
--config "$GITHUB_WORKSPACE/.tflint.hcl" \
38+
| tee tflint-results.sarif
39+
exit "${PIPESTATUS[0]}"
40+
- name: Parse SARIF file for annotations
41+
if: always()
42+
uses: jontyms/sarif-annotations@v0.0.3
43+
with:
44+
annotation-level: notice
45+
sarif-file: tflint-results.sarif
46+
# When run on main, upload the SARIF file to GitHub.
47+
- name: Upload SARIF result
48+
if: always() && github.ref == 'refs/heads/main'
49+
uses: github/codeql-action/upload-sarif@v4
50+
with:
51+
sarif_file: tflint-results.sarif

.github/workflows/trivy.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Trivy Analysis
2+
3+
on:
4+
push:
5+
6+
permissions:
7+
contents: read
8+
security-events: write
9+
10+
jobs:
11+
trivy:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout source code
15+
uses: actions/checkout@v6
16+
- name: Run Trivy vulnerability scanner
17+
uses: aquasecurity/trivy-action@0.33.1
18+
with:
19+
scan-type: config
20+
ignore-unfixed: true
21+
skip-dirs: "**/*/.terraform"
22+
exit-code: 1
23+
format: sarif
24+
output: trivy-results.sarif
25+
- name: Parse SARIF file for annotations
26+
if: always()
27+
uses: jontyms/sarif-annotations@v0.0.3
28+
with:
29+
annotation-level: notice
30+
sarif-file: trivy-results.sarif
31+
# When run on main, upload the SARIF file to GitHub.
32+
- name: Upload SARIF result
33+
if: always() && github.ref == 'refs/heads/main'
34+
uses: github/codeql-action/upload-sarif@v4
35+
with:
36+
sarif_file: trivy-results.sarif

0 commit comments

Comments
 (0)