Skip to content

Commit aa7e007

Browse files
committed
chore(repo): pin GitHub Actions to SHAs and drop persisted tokens
Convert every `uses:` reference in `.github/workflows/**` and `.github/actions/**` from a mutable tag to an immutable commit SHA, with the tag preserved as a trailing comment so the version is still readable. Extend the Renovate config generator to manage the `.github/**` paths (previously outside `includePaths`) with `pinDigests: true`, so the SHAs stay current automatically. Set `persist-credentials: false` on every `actions/checkout` step that does not require the persisted `GITHUB_TOKEN`. The release job in `release.yml` is intentionally left alone: it sets a `token:` input explicitly so `changesets/action` can push the Version PR.
1 parent fc740b2 commit aa7e007

18 files changed

Lines changed: 148 additions & 74 deletions

.changeset/harden-gh-actions.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

.github/actions/ensure-stable-pr/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ runs:
88
using: 'composite'
99
steps:
1010
- name: Ensure the PR hasn't changed since initiating the commented command.
11-
uses: actions/github-script@v7
11+
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
1212
env:
1313
CMD: ${{ inputs.cmd }}
1414
with:

.github/actions/init-blacksmith/action.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ runs:
4848
steps:
4949
- name: Configure Turborepo
5050
id: turbo
51-
uses: actions/github-script@v7
51+
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
5252
env:
5353
# envs are required to pass inputs to the script
5454
CACHE: ${{ inputs.turbo-cache }}
@@ -110,10 +110,10 @@ runs:
110110
run: echo $TURBO_ARGS
111111

112112
- name: Install PNPM
113-
uses: pnpm/action-setup@v4
113+
uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
114114

115115
- name: Setup NodeJS ${{ inputs.node-version }}
116-
uses: useblacksmith/setup-node@v5
116+
uses: useblacksmith/setup-node@65c6ca86fdeb0ab3d85e78f57e4f6a7e4780b391 # v5
117117
with:
118118
cache: ${{ inputs.cache-enabled == 'true' && 'pnpm' || '' }}
119119
node-version: ${{ inputs.node-version }}
@@ -139,7 +139,7 @@ runs:
139139
140140
- name: Cache Playwright Binaries
141141
if: inputs.playwright-enabled == 'true' && inputs.cache-enabled == 'true'
142-
uses: useblacksmith/cache@v5
142+
uses: useblacksmith/cache@71c7c918062ba3861252d84b07fe5ab2a6b467a6 # v5
143143
id: playwright-cache
144144
with:
145145
path: ~/.cache/ms-playwright

.github/actions/init/action.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ runs:
4848
steps:
4949
- name: Configure Turborepo
5050
id: turbo
51-
uses: actions/github-script@v7
51+
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
5252
env:
5353
# envs are required to pass inputs to the script
5454
CACHE: ${{ inputs.turbo-cache }}
@@ -110,10 +110,10 @@ runs:
110110
run: echo $TURBO_ARGS
111111

112112
- name: Install PNPM
113-
uses: pnpm/action-setup@v4
113+
uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
114114

115115
- name: Setup NodeJS ${{ inputs.node-version }}
116-
uses: actions/setup-node@v4
116+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
117117
with:
118118
cache: ${{ inputs.cache-enabled == 'true' && 'pnpm' || '' }}
119119
node-version: ${{ inputs.node-version }}
@@ -139,7 +139,7 @@ runs:
139139
140140
- name: Cache Playwright Binaries
141141
if: inputs.playwright-enabled == 'true' && inputs.cache-enabled == 'true'
142-
uses: actions/cache@v4
142+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
143143
id: playwright-cache
144144
with:
145145
path: ~/.cache/ms-playwright

.github/workflows/ci.yml

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- name: Get User Permission
3232
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository }}
3333
id: checkAccess
34-
uses: actions-cool/check-user-permission@v2
34+
uses: actions-cool/check-user-permission@c21884f3dda18dafc2f8b402fe807ccc9ec1aa5e # v2
3535
with:
3636
require: write
3737
username: ${{ github.triggering_actor }}
@@ -57,8 +57,9 @@ jobs:
5757

5858
steps:
5959
- name: Checkout Repo
60-
uses: actions/checkout@v4
60+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
6161
with:
62+
persist-credentials: false
6263
fetch-depth: 100 # Enough for changeset status comparison, much faster than full history
6364
fetch-tags: false
6465
filter: "blob:none"
@@ -109,8 +110,9 @@ jobs:
109110

110111
steps:
111112
- name: Checkout Repo
112-
uses: actions/checkout@v4
113+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
113114
with:
115+
persist-credentials: false
114116
fetch-depth: 1
115117
fetch-tags: false
116118
filter: "blob:none"
@@ -130,7 +132,7 @@ jobs:
130132
run: pnpm turbo build $TURBO_ARGS --only
131133

132134
- name: Upload Turbo Summary
133-
uses: actions/upload-artifact@v4
135+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
134136
if: ${{ env.TURBO_SUMMARIZE == 'true' }}
135137
continue-on-error: true
136138
with:
@@ -156,8 +158,9 @@ jobs:
156158

157159
steps:
158160
- name: Checkout Repo
159-
uses: actions/checkout@v4
161+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
160162
with:
163+
persist-credentials: false
161164
fetch-depth: 1
162165
fetch-tags: false
163166
filter: "blob:none"
@@ -194,7 +197,7 @@ jobs:
194197
run: pnpm turbo lint $TURBO_ARGS
195198

196199
- name: Upload Turbo Summary
197-
uses: actions/upload-artifact@v4
200+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
198201
if: ${{ env.TURBO_SUMMARIZE == 'true' }}
199202
continue-on-error: true
200203
with:
@@ -231,8 +234,9 @@ jobs:
231234

232235
steps:
233236
- name: Checkout Repo
234-
uses: actions/checkout@v4
237+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
235238
with:
239+
persist-credentials: false
236240
fetch-depth: 1
237241
fetch-tags: false
238242
filter: "blob:none"
@@ -272,7 +276,7 @@ jobs:
272276
NODE_VERSION: ${{ matrix.node-version }}
273277

274278
- name: Upload Turbo Summary
275-
uses: actions/upload-artifact@v4
279+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
276280
if: ${{ env.TURBO_SUMMARIZE == 'true' }}
277281
continue-on-error: true
278282
with:
@@ -342,8 +346,9 @@ jobs:
342346

343347
steps:
344348
- name: Checkout Repo
345-
uses: actions/checkout@v4
349+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
346350
with:
351+
persist-credentials: false
347352
fetch-depth: 1
348353
fetch-tags: false
349354
filter: "blob:none"
@@ -435,7 +440,7 @@ jobs:
435440
run: cd packages/astro && pnpm copy:components
436441

437442
- name: Write all ENV certificates to files in integration/certs
438-
uses: actions/github-script@v7
443+
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
439444
env:
440445
INTEGRATION_CERTS: "${{secrets.INTEGRATION_CERTS}}"
441446
INTEGRATION_ROOT_CA: "${{secrets.INTEGRATION_ROOT_CA}}"
@@ -483,7 +488,7 @@ jobs:
483488

484489
- name: Upload test-results
485490
if: ${{ cancelled() || failure() }}
486-
uses: actions/upload-artifact@v4
491+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
487492
with:
488493
name: playwright-traces-${{ github.run_id }}-${{ github.run_attempt }}-${{ steps.sanitize.outputs.artifact-suffix }}${{ matrix.next-version && format('-next{0}', matrix.next-version) || '' }}
489494
path: test-results
@@ -503,8 +508,9 @@ jobs:
503508

504509
steps:
505510
- name: Checkout repository
506-
uses: actions/checkout@v4
511+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
507512
with:
513+
persist-credentials: false
508514
fetch-depth: 1
509515
fetch-tags: false
510516
filter: "blob:none"

.github/workflows/e2e-cleanups.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ jobs:
1616

1717
steps:
1818
- name: Checkout Repo
19-
uses: actions/checkout@v4
19+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
2020
with:
21+
persist-credentials: false
2122
fetch-depth: 0
2223
show-progress: false
2324

.github/workflows/e2e-staging.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
runs-on: 'blacksmith-8vcpu-ubuntu-2204'
4444
steps:
4545
- name: Check org membership
46-
uses: actions/github-script@v7
46+
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
4747
with:
4848
script: |
4949
const org = context.repo.owner;
@@ -97,8 +97,9 @@ jobs:
9797
fi
9898
9999
- name: Checkout Repo
100-
uses: actions/checkout@v4
100+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
101101
with:
102+
persist-credentials: false
102103
ref: ${{ steps.inputs.outputs.ref }}
103104
sparse-checkout: scripts/validate-staging-instances.mjs
104105
fetch-depth: 1
@@ -173,8 +174,9 @@ jobs:
173174
fi
174175
175176
- name: Checkout Repo
176-
uses: actions/checkout@v4
177+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
177178
with:
179+
persist-credentials: false
178180
ref: ${{ steps.inputs.outputs.ref }}
179181
fetch-depth: 1
180182
fetch-tags: false
@@ -245,7 +247,7 @@ jobs:
245247
pnpm add @clerk/ui@latest
246248
247249
- name: Write all ENV certificates to files in integration/certs
248-
uses: actions/github-script@v7
250+
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
249251
env:
250252
INTEGRATION_CERTS: '${{ secrets.INTEGRATION_CERTS }}'
251253
INTEGRATION_ROOT_CA: '${{ secrets.INTEGRATION_ROOT_CA }}'
@@ -285,7 +287,7 @@ jobs:
285287

286288
- name: Upload test-results
287289
if: ${{ cancelled() || failure() }}
288-
uses: actions/upload-artifact@v4
290+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
289291
with:
290292
name: playwright-traces-${{ github.run_id }}-${{ github.run_attempt }}-${{ steps.inputs.outputs.artifact-suffix }}
291293
path: test-results
@@ -328,7 +330,7 @@ jobs:
328330
329331
- name: Notify Slack on failure
330332
if: ${{ needs.integration-tests.result == 'failure' && steps.inputs.outputs.notify-slack == 'true' }}
331-
uses: slackapi/slack-github-action@v1.24.0
333+
uses: slackapi/slack-github-action@e28cf165c92ffef168d23c5c9000cffc8a25e117 # v1.24.0
332334
with:
333335
payload: |
334336
{
@@ -349,7 +351,7 @@ jobs:
349351
# Uncomment when clerk_go side is ready
350352
# - name: Post commit status to clerk_go
351353
# if: ${{ steps.inputs.outputs.clerk-go-commit-sha != '' }}
352-
# uses: actions/github-script@v7
354+
# uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
353355
# with:
354356
# github-token: ${{ secrets.CLERK_COOKIE_PAT }}
355357
# script: |

.github/workflows/labeler.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ jobs:
1111
pull-requests: write
1212
runs-on: ${{ vars.RUNNER_NORMAL || 'ubuntu-latest' }}
1313
steps:
14-
- uses: actions/labeler@v6
14+
- uses: actions/labeler@f27b608878404679385c85cfa523b85ccb86e213 # v6

.github/workflows/lock-threads.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
timeout-minutes: 3
2020
runs-on: ${{ vars.RUNNER_NORMAL || 'ubuntu-latest' }}
2121
steps:
22-
- uses: actions/stale@v9
22+
- uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 # v9
2323
name: Regular stale action
2424
with:
2525
days-before-issue-stale: 30
@@ -56,7 +56,7 @@ jobs:
5656
After 60 days of no activity, we'll close this PR. Keep in mind, I'm just a robot, so if I've closed this PR in error, please reply here and my human colleagues will reopen it.
5757
5858
Thanks for being a part of the Clerk community! 🙏
59-
- uses: actions/stale@v9
59+
- uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 # v9
6060
name: Stale action for needs-reproduction issues
6161
with:
6262
days-before-issue-stale: 7
@@ -73,7 +73,7 @@ jobs:
7373
Thanks for being a part of the Clerk community! 🙏
7474
close-issue-message: |
7575
After 8 days without a reproduction being supplied, we are closing this issue. Keep in mind, I'm just a robot, so if I've closed this issue in error, please reply here and my human colleagues will reopen it. Likewise if a reproduction is prepared after it has been closed.
76-
- uses: dessant/lock-threads@v4
76+
- uses: dessant/lock-threads@be8aa5be94131386884a6da4189effda9b14aa21 # v4
7777
with:
7878
issue-inactive-days: '365'
7979
issue-comment: 'This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.'

.github/workflows/major-version-check.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
steps:
1919
- name: Check for major changesets
2020
id: check_major
21-
uses: actions/github-script@v7
21+
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
2222
with:
2323
script: |
2424
const prNumber = context.payload?.pull_request?.number || context.payload?.issue?.number;
@@ -74,7 +74,7 @@ jobs:
7474
- name: Check if major version bump is allowed
7575
if: steps.check_major.outputs.has_major_changeset == 'true'
7676
id: check_approval
77-
uses: actions/github-script@v7
77+
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
7878
with:
7979
script: |
8080
const prNumber = context.payload?.pull_request?.number || context.payload?.issue?.number;

0 commit comments

Comments
 (0)