Skip to content

Commit 10e1a5d

Browse files
ci: pin all GitHub Actions to commit SHAs and add minimal permissions (microsoft#732)
1 parent 0dadd3e commit 10e1a5d

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

.github/workflows/golangci-lint.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,19 @@ on:
44
branches:
55
- main
66
pull_request:
7+
8+
permissions:
9+
contents: read
10+
711
jobs:
812
golangci-pr:
913
name: lint-pr-changes
1014
runs-on: ubuntu-latest
1115
steps:
12-
# Pinned to commit SHA for supply chain security (CWE-829)
13-
# Verify: gh api repos/actions/setup-go/git/ref/tags/v6 --jq '.object.sha'
14-
- uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
16+
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
1517
with:
1618
go-version: '1.25.9'
17-
- uses: actions/checkout@v6
19+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1820
- name: golangci-lint
1921
# Pinned to commit SHA for supply chain security (CWE-829)
2022
# Verify: gh api repos/golangci/golangci-lint-action/git/ref/tags/v9 --jq '.object.sha'

.github/workflows/pr-validation.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,16 @@ on:
55
branches:
66
- main
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
build:
1013
runs-on: ubuntu-latest
1114
steps:
12-
- uses: actions/checkout@v6
15+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1316
- name: Setup go
14-
uses: actions/setup-go@v6
17+
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
1518
with:
1619
go-version: '1.25.9'
1720
- name: Run tests against Linux SQL

.github/workflows/security.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ jobs:
2424
runs-on: ubuntu-latest
2525
steps:
2626
- name: Checkout code
27-
uses: actions/checkout@v6
27+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2828

2929
- name: Setup Go
30-
uses: actions/setup-go@v6
30+
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
3131
with:
3232
go-version-file: go.mod
3333

0 commit comments

Comments
 (0)