Skip to content

Commit 8bb6948

Browse files
committed
security: harden github actions
1 parent 4aee211 commit 8bb6948

4 files changed

Lines changed: 22 additions & 14 deletions

File tree

.github/actions/setup/action.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@ runs:
1313
using: "composite"
1414
steps:
1515
- name: Install Just
16-
uses: extractions/setup-just@v3
16+
uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 #v4
1717
env:
1818
GITHUB_TOKEN: ${{ github.token }}
1919
- name: Install pnpm
20-
uses: pnpm/action-setup@v4
20+
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 #v6.0.8
2121
if: ${{ !inputs.pnpm-version }}
2222
- name: Install pnpm (override)
23-
uses: pnpm/action-setup@v4
23+
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 #v6.0.8
2424
if: ${{ inputs.pnpm-version }}
2525
with:
2626
version: ${{ inputs.pnpm-version }}
2727
- name: Set up Go
28-
uses: actions/setup-go@v6
28+
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c #v6.4.0
2929
with:
3030
go-version: ${{ inputs.go-version }}
3131
go-version-file: ${{ inputs.go-version && '' || 'go.mod' }}

.github/workflows/ci.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout repository
13-
uses: actions/checkout@v6
13+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2
14+
with:
15+
persist-credentials: false
1416
- name: Run Common Setup
1517
uses: ./.github/actions/setup
1618
- name: Cache Go tools
17-
uses: actions/cache@v5
19+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae #v5.0.5
1820
with:
1921
path: |
2022
~/go/bin/golangci-lint
@@ -36,7 +38,9 @@ jobs:
3638
runs-on: ubuntu-latest
3739
steps:
3840
- name: Checkout repository
39-
uses: actions/checkout@v6
41+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2
42+
with:
43+
persist-credentials: false
4044
- name: Run Common Setup
4145
uses: ./.github/actions/setup
4246
- name: Build Templates
@@ -49,13 +53,15 @@ jobs:
4953
needs: [lint, test]
5054
steps:
5155
- name: Checkout repository
52-
uses: actions/checkout@v6
56+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2
57+
with:
58+
persist-credentials: false
5359
- name: Run Common Setup
5460
uses: ./.github/actions/setup
5561
- name: Build Application
5662
run: just build
5763
- name: Upload binary
58-
uses: actions/upload-artifact@v7
64+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a #v7.0.1
5965
if: github.ref == 'refs/heads/main'
6066
with:
6167
name: pkgstatsd
@@ -68,7 +74,7 @@ jobs:
6874
if: github.ref == 'refs/heads/main'
6975
steps:
7076
- name: Download binary
71-
uses: actions/download-artifact@v8
77+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c #v8.0.1
7278
with:
7379
name: pkgstatsd
7480
- name: Deploy

.github/workflows/update-go.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout repository
13-
uses: actions/checkout@v6
13+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2
1414
with:
1515
token: ${{ secrets.MAINTENANCE_TOKEN }}
16+
persist-credentials: false
1617
- name: Run Common Setup
1718
uses: ./.github/actions/setup
1819
with:
@@ -30,7 +31,7 @@ jobs:
3031
- name: Run Tests
3132
run: just test
3233
- name: Commit updates
33-
uses: stefanzweifel/git-auto-commit-action@v7
34+
uses: stefanzweifel/git-auto-commit-action@04702edda442b2e678b25b537cec683a1493fcb9 #v7.1.0
3435
with:
3536
commit_message: Update Go dependencies
3637
commit_user_name: Maintenance Bob

.github/workflows/update-pnpm.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout repository
13-
uses: actions/checkout@v6
13+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2
1414
with:
1515
token: ${{ secrets.MAINTENANCE_TOKEN }}
16+
persist-credentials: false
1617
- name: Fetch latest pnpm version and update package.json
1718
run: |
1819
LATEST=$(npm view pnpm version)
@@ -34,7 +35,7 @@ jobs:
3435
- name: Run Tests
3536
run: just test
3637
- name: Commit updates
37-
uses: stefanzweifel/git-auto-commit-action@v7
38+
uses: stefanzweifel/git-auto-commit-action@04702edda442b2e678b25b537cec683a1493fcb9 #v7.1.0
3839
with:
3940
commit_message: Update pnpm dependencies
4041
commit_user_name: Maintenance Bob

0 commit comments

Comments
 (0)