Skip to content

Commit ec57cb5

Browse files
authored
CI: Pin GitHub Actions and fix zizmor high-severity findings (#667)
## Description This PR fixes zizmor --min-severity high findings in our GitHub Actions workflows by: - Pinning all uses: references to immutable commit SHAs (replaces floating tags like @v6 / @main). - Pinning internal Terraform setup action usage (coder/coder/.github/actions/setup-tf@main) to a fixed ref/commit. - Pinning crate-ci/typos to a commit SHA. - Removing GitHub expression template expansion inside a run: block in version-bump.yaml (prevents template injection flagged by zizmor). ## Type of Change - [ ] New module - [ ] New template - [ ] Bug fix - [ ] Feature/enhancement - [ ] Documentation - [x] Other ## Module Information N/A ## Template Information N/A ## Testing & Validation - [ ] Tests pass (`bun test`) - [ ] Code formatted (`bun fmt`) - [x] Changes tested locally - zizmor .github/workflows/* --min-severity high ## Related Issues - #642 - #662
1 parent d21f55a commit ec57cb5

File tree

6 files changed

+26
-24
lines changed

6 files changed

+26
-24
lines changed

.github/workflows/check_registry_site_health.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111

1212
steps:
1313
- name: Checkout repository
14-
uses: actions/checkout@v6
14+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
1515

1616
- name: Run check.sh
1717
run: |

.github/workflows/ci.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- name: Check out code
15-
uses: actions/checkout@v6
15+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
1616
- name: Detect changed files
17-
uses: dorny/paths-filter@v3
17+
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3
1818
id: filter
1919
with:
2020
list-files: shell
@@ -37,9 +37,9 @@ jobs:
3737
all:
3838
- '**'
3939
- name: Set up Terraform
40-
uses: coder/coder/.github/actions/setup-tf@main
40+
uses: coder/coder/.github/actions/setup-tf@59cdd7e21f4d7da12567c0c29964d298fbf38f27 # v2.29.1
4141
- name: Set up Bun
42-
uses: oven-sh/setup-bun@v2
42+
uses: oven-sh/setup-bun@3d267786b128fe76c2f16a390aa2448b815359f3 # v2
4343
with:
4444
# We're using the latest version of Bun for now, but it might be worth
4545
# reconsidering. They've pushed breaking changes in patch releases
@@ -80,20 +80,20 @@ jobs:
8080
runs-on: ubuntu-latest
8181
steps:
8282
- name: Check out code
83-
uses: actions/checkout@v6
83+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
8484
- name: Install Bun
85-
uses: oven-sh/setup-bun@v2
85+
uses: oven-sh/setup-bun@3d267786b128fe76c2f16a390aa2448b815359f3 # v2
8686
with:
8787
bun-version: latest
8888
# Need Terraform for its formatter
8989
- name: Install Terraform
90-
uses: coder/coder/.github/actions/setup-tf@main
90+
uses: coder/coder/.github/actions/setup-tf@59cdd7e21f4d7da12567c0c29964d298fbf38f27 # v2.29.1
9191
- name: Install dependencies
9292
run: bun install
9393
- name: Validate formatting
9494
run: bun fmt:ci
9595
- name: Check for typos
96-
uses: crate-ci/[email protected]
96+
uses: crate-ci/typos@bb4666ad77b539a6b4ce4eda7ebb6de553704021 # v1.42.0
9797
with:
9898
config: .github/typos.toml
9999
validate-readme-files:
@@ -104,9 +104,9 @@ jobs:
104104
needs: validate-style
105105
steps:
106106
- name: Check out code
107-
uses: actions/checkout@v6
107+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
108108
- name: Set up Go
109-
uses: actions/setup-go@v6
109+
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6
110110
with:
111111
go-version: "1.24.0"
112112
- name: Validate contributors

.github/workflows/deploy-registry.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828

2929
steps:
3030
- name: Checkout code
31-
uses: actions/checkout@v6
31+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
3232
- name: Authenticate with Google Cloud
3333
uses: google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093
3434
with:

.github/workflows/golangci-lint.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ jobs:
1414
name: lint
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@v6
18-
- uses: actions/setup-go@v6
17+
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
18+
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6
1919
with:
2020
go-version: stable
2121
- name: golangci-lint
22-
uses: golangci/golangci-lint-action@v9
22+
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9
2323
with:
2424
version: v2.1

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414

1515
steps:
1616
- name: Checkout code
17-
uses: actions/checkout@v6
17+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
1818
with:
1919
fetch-depth: 0
2020
persist-credentials: false
@@ -89,9 +89,9 @@ jobs:
8989
9090
for sha in $MODULE_COMMIT_SHAS; do
9191
SHORT_SHA=${sha:0:7}
92-
92+
9393
COMMIT_LINES=$(echo "$FULL_CHANGELOG" | grep -E "$SHORT_SHA|$(git log --format='%s' -n 1 $sha)" || true)
94-
94+
9595
if [ -n "$COMMIT_LINES" ]; then
9696
FILTERED_CHANGELOG="${FILTERED_CHANGELOG}${COMMIT_LINES}\n"
9797
else

.github/workflows/version-bump.yaml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,26 +20,28 @@ jobs:
2020
issues: write
2121
steps:
2222
- name: Checkout code
23-
uses: actions/checkout@v6
23+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
2424
with:
2525
fetch-depth: 0
2626
token: ${{ secrets.GITHUB_TOKEN }}
2727

2828
- name: Set up Bun
29-
uses: oven-sh/setup-bun@v2
29+
uses: oven-sh/setup-bun@3d267786b128fe76c2f16a390aa2448b815359f3 # v2
3030
with:
3131
bun-version: latest
3232

3333
- name: Set up Terraform
34-
uses: coder/coder/.github/actions/setup-tf@main
34+
uses: coder/coder/.github/actions/setup-tf@59cdd7e21f4d7da12567c0c29964d298fbf38f27 # v2.29.1
3535

3636
- name: Install dependencies
3737
run: bun install
3838

3939
- name: Extract bump type from label
40+
env:
41+
LABEL_NAME: ${{ github.event.label.name }}
4042
id: bump-type
4143
run: |
42-
case "${{ github.event.label.name }}" in
44+
case "$LABEL_NAME" in in
4345
"version:patch")
4446
echo "type=patch" >> $GITHUB_OUTPUT
4547
;;
@@ -50,7 +52,7 @@ jobs:
5052
echo "type=major" >> $GITHUB_OUTPUT
5153
;;
5254
*)
53-
echo "Invalid version label: ${{ github.event.label.name }}"
55+
echo "Invalid version label: ${LABEL_NAME}"
5456
exit 1
5557
;;
5658
esac
@@ -60,7 +62,7 @@ jobs:
6062

6163
- name: Comment on PR - Version bump required
6264
if: failure()
63-
uses: actions/github-script@v8
65+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
6466
with:
6567
github-token: ${{ secrets.GITHUB_TOKEN }}
6668
script: |

0 commit comments

Comments
 (0)