Skip to content

Commit 17e7493

Browse files
rohankmr414claude
andcommitted
ci: pin GitHub Actions to commit SHAs for supply chain security
Replace mutable tag references with immutable commit SHAs across workflow files. Original tags are preserved as inline comments. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 1dd8e88 commit 17e7493

2 files changed

Lines changed: 24 additions & 24 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@ jobs:
1515
runs-on: ubuntu-22.04
1616
steps:
1717
- name: Checkout 🛎️
18-
uses: actions/checkout@v3
18+
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
1919

2020
- name: Install Nix ❄
21-
uses: DeterminateSystems/nix-installer-action@v4
21+
uses: DeterminateSystems/nix-installer-action@65d7c888b2778e8cf30a07a88422ccb23499bfb8 # v4
2222

2323
- name: Link Cachix 🔌
24-
uses: cachix/cachix-action@v12
24+
uses: cachix/cachix-action@6a9a34cdd93d0ae4b4b59fd678660efb08109f2f # v12
2525
with:
2626
name: '${{ vars.CACHIX_CACHE_NAME }}'
2727
authToken: '${{ secrets.CACHIX_CACHE_AUTH_TOKEN }}'
2828

2929
- name: Login to GitHub Container Registry 📦
30-
uses: docker/login-action@v1
30+
uses: docker/login-action@dd4fa0671be5250ee6f50aedf4cb05514abda2c7 # v1
3131
with:
3232
registry: ghcr.io
3333
username: ${{ github.actor }}
@@ -47,19 +47,19 @@ jobs:
4747
runs-on: ubuntu-24.04
4848
steps:
4949
- name: Checkout 🛎️
50-
uses: actions/checkout@v3
50+
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
5151

5252
- name: Install Nix ❄
53-
uses: DeterminateSystems/nix-installer-action@v4
53+
uses: DeterminateSystems/nix-installer-action@65d7c888b2778e8cf30a07a88422ccb23499bfb8 # v4
5454

5555
- name: Link Cachix 🔌
56-
uses: cachix/cachix-action@v12
56+
uses: cachix/cachix-action@6a9a34cdd93d0ae4b4b59fd678660efb08109f2f # v12
5757
with:
5858
name: '${{ vars.CACHIX_CACHE_NAME }}'
5959
authToken: '${{ secrets.CACHIX_CACHE_AUTH_TOKEN }}'
6060

6161
- name: Login to GitHub Container Registry 📦
62-
uses: docker/login-action@v1
62+
uses: docker/login-action@dd4fa0671be5250ee6f50aedf4cb05514abda2c7 # v1
6363
with:
6464
registry: ghcr.io
6565
username: ${{ github.actor }}
@@ -72,7 +72,7 @@ jobs:
7272
cp result/bin/mongodb-connector release/mongodb-connector-${{ matrix.target }}
7373
7474
- name: Upload binaries to workflow artifacts 🚀
75-
uses: actions/upload-artifact@v4
75+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
7676
with:
7777
name: mongodb-connector-${{ matrix.target }}
7878
path: release
@@ -110,10 +110,10 @@ jobs:
110110
run:
111111
shell: bash
112112
steps:
113-
- uses: actions/checkout@v4
113+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
114114

115115
- name: install protoc
116-
uses: arduino/setup-protoc@v3
116+
uses: arduino/setup-protoc@c65c819552d16ad3c9b72d9dfd5ba5237b9c906b # v3
117117
with:
118118
version: "25.x"
119119
repo-token: ${{ secrets.GITHUB_TOKEN }}
@@ -129,7 +129,7 @@ jobs:
129129
sudo apt-get update
130130
sudo apt-get install -y ${{ matrix.linux-packages }}
131131
132-
- uses: Swatinem/rust-cache@v2
132+
- uses: Swatinem/rust-cache@42dc69e1aa15d09112580998cf2ef0119e2e91ae # v2
133133
with:
134134
shared-key: "build" # share the cache across jobs
135135

@@ -164,7 +164,7 @@ jobs:
164164
mkdir -p release
165165
mv -v target/${{ matrix.target }}/release/mongodb-cli-plugin release/mongodb-cli-plugin-${{ matrix.target }}${{ matrix.extension }}
166166
167-
- uses: actions/upload-artifact@v4
167+
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
168168
with:
169169
name: mongodb-cli-plugin-${{ matrix.target }}${{ matrix.extension }}
170170
path: release
@@ -179,9 +179,9 @@ jobs:
179179
runs-on: ubuntu-24.04
180180
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
181181
steps:
182-
- uses: actions/checkout@v4
182+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
183183

184-
- uses: actions/download-artifact@v4
184+
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
185185
with:
186186
path: release/artifacts
187187
merge-multiple: true
@@ -209,7 +209,7 @@ jobs:
209209
export VERSION="$GITHUB_REF_NAME"
210210
./scripts/generate-manifest.sh
211211
212-
- uses: actions/upload-artifact@v4
212+
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
213213
with:
214214
name: manifest.yaml
215215
path: release/manifest.yaml
@@ -221,14 +221,14 @@ jobs:
221221
echo "tagged_version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
222222
shell: bash
223223

224-
- uses: mindsers/changelog-reader-action@v2
224+
- uses: mindsers/changelog-reader-action@97a0b06549019bb99a571f1664272db18031acff # v2
225225
id: changelog-reader
226226
with:
227227
version: ${{ steps.get-version.outputs.tagged_version }}
228228
path: ./CHANGELOG.md
229229

230230
- name: create a draft release
231-
uses: ncipollo/release-action@v1
231+
uses: ncipollo/release-action@339a81892b84b4eeb0f6e744e4574d79d0d9b8dd # v1
232232
with:
233233
draft: true
234234
tag: v${{ steps.get-version.outputs.tagged_version }}

.github/workflows/test.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ jobs:
1313
runs-on: ubuntu-24.04
1414
steps:
1515
- name: Checkout 🛎️
16-
uses: actions/checkout@v3
16+
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
1717

1818
- name: Install Nix ❄
19-
uses: DeterminateSystems/nix-installer-action@v4
19+
uses: DeterminateSystems/nix-installer-action@65d7c888b2778e8cf30a07a88422ccb23499bfb8 # v4
2020

2121
- name: Link Cachix 🔌
22-
uses: cachix/cachix-action@v12
22+
uses: cachix/cachix-action@6a9a34cdd93d0ae4b4b59fd678660efb08109f2f # v12
2323
with:
2424
name: '${{ vars.CACHIX_CACHE_NAME }}'
2525
authToken: '${{ secrets.CACHIX_CACHE_AUTH_TOKEN }}'
@@ -41,13 +41,13 @@ jobs:
4141
runs-on: ubuntu-24.04
4242
steps:
4343
- name: Checkout 🛎️
44-
uses: actions/checkout@v3
44+
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
4545

4646
- name: Install Nix ❄
47-
uses: DeterminateSystems/nix-installer-action@v4
47+
uses: DeterminateSystems/nix-installer-action@65d7c888b2778e8cf30a07a88422ccb23499bfb8 # v4
4848

4949
- name: Link Cachix 🔌
50-
uses: cachix/cachix-action@v12
50+
uses: cachix/cachix-action@6a9a34cdd93d0ae4b4b59fd678660efb08109f2f # v12
5151
with:
5252
name: '${{ vars.CACHIX_CACHE_NAME }}'
5353
authToken: '${{ secrets.CACHIX_CACHE_AUTH_TOKEN }}'

0 commit comments

Comments
 (0)