Skip to content

Commit f6897a6

Browse files
Pin GitHub Actions to full-length commit SHAs (#11786)
Our workflows reference third-party and first-party actions by mutable tags (`actions/checkout@v7`, `pnpm/action-setup@v6`, …). A tag can be repointed at any commit, so anyone who can move a tag in one of those repos can silently run arbitrary code inside our CI — including on jobs that hold write tokens. Every `uses:` in `.github/` is now pinned to an immutable commit SHA, with the human-readable version kept as a trailing comment: ```yaml - uses: actions/checkout@3d3c42e # v7.0.1 ``` All pinned SHAs were verified to resolve from the tag they claim, and no unpinned `uses:` references remain. Picks up the action-pinning portion of #11730; the Dependabot `github-actions` ecosystem entry is intentionally left out of this PR. --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent eea1016 commit f6897a6

17 files changed

Lines changed: 56 additions & 54 deletions

.github/actions/setup/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ runs:
1111

1212
steps:
1313
- name: Install pnpm
14-
uses: pnpm/action-setup@v6
14+
uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10
1515

1616
- name: Set node version to ${{ inputs.node-version }}
17-
uses: actions/setup-node@v5
17+
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
1818
with:
1919
node-version: ${{ inputs.node-version }}
2020
cache: pnpm

.github/workflows/check-agentic-workflows.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@ jobs:
1414
check-lock-files:
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@v7
17+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
1818

1919
- name: Install gh-aw
20-
run: curl -sL https://raw.githubusercontent.com/github/gh-aw/main/install-gh-aw.sh | bash -s -- v0.80.9
20+
uses: github/gh-aw/actions/setup-cli@bbb8042878459948333b15b66f27113f4b5c1b9a # v0.83.4
21+
with:
22+
version: v0.80.9
2123

2224
- name: Compile and check for drift
2325
run: |

.github/workflows/ci-emitter-diff-python.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ jobs:
3737
# Fork PRs are intentionally skipped
3838
if: github.event.pull_request.head.repo.fork != true
3939
steps:
40-
- uses: actions/checkout@v7
40+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
4141
with:
4242
fetch-depth: 0
4343
- uses: ./.github/actions/setup
44-
- uses: actions/setup-python@v7
44+
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
4545
with:
4646
python-version: "3.12"
4747

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ jobs:
2424
outputs:
2525
core: ${{ steps.filter.outputs.core }}
2626
steps:
27-
- uses: actions/checkout@v7
27+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
2828
# cspell:ignore dorny
29-
- uses: dorny/paths-filter@7b450fff21473bca461d4b92ce414b9d0420d706 # v4
29+
- uses: dorny/paths-filter@7b450fff21473bca461d4b92ce414b9d0420d706 # v4.0.2
3030
id: filter
3131
with:
3232
predicate-quantifier: "every"

.github/workflows/codeql.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ jobs:
3737

3838
steps:
3939
- name: Checkout repository
40-
uses: actions/checkout@v7
40+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
4141

4242
# Initializes the CodeQL tools for scanning.
4343
- name: Initialize CodeQL
44-
uses: github/codeql-action/init@v4.37.3
44+
uses: github/codeql-action/init@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4.37.3
4545
with:
4646
languages: ${{ matrix.language }}
4747
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -54,7 +54,7 @@ jobs:
5454
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
5555
# If this step fails, then you should remove it and run the build manually (see below)
5656
- name: Autobuild
57-
uses: github/codeql-action/autobuild@v4.37.3
57+
uses: github/codeql-action/autobuild@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4.37.3
5858

5959
# ℹ️ Command-line programs to run using the OS shell.
6060
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -67,6 +67,6 @@ jobs:
6767
# ./location_of_script_within_repo/buildscript.sh
6868

6969
- name: Perform CodeQL Analysis
70-
uses: github/codeql-action/analyze@v4.37.3
70+
uses: github/codeql-action/analyze@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4.37.3
7171
with:
7272
category: "/language:${{matrix.language}}"

.github/workflows/commenter.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ jobs:
1818
!startsWith(github.head_ref, 'publish/')
1919
runs-on: ubuntu-latest
2020
steps:
21-
- uses: actions/checkout@v7
21+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
2222
- name: Prepare artifact directory
2323
run: mkdir -p "${{ runner.temp }}/comment-artifact"
24-
- uses: actions/download-artifact@v8
24+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
2525
with:
2626
name: comment
2727
run-id: ${{github.event.workflow_run.id }}

.github/workflows/consistency.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
!startsWith(github.head_ref, 'backmerge/') &&
2727
!startsWith(github.head_ref, 'revert-')
2828
steps:
29-
- uses: actions/checkout@v7
29+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
3030
with:
3131
fetch-depth: 0 ## Needed for Changesets to find `main` branch
3232

@@ -43,7 +43,7 @@ jobs:
4343
env:
4444
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
4545

46-
- uses: actions/upload-artifact@v7
46+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
4747
with:
4848
name: comment
4949
path: comment-out/
@@ -57,7 +57,7 @@ jobs:
5757
name: Spell check
5858
runs-on: ubuntu-latest
5959
steps:
60-
- uses: actions/checkout@v7
60+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
6161
with:
6262
submodules: recursive
6363
- uses: ./.github/actions/setup
@@ -73,7 +73,7 @@ jobs:
7373
name: Format
7474
runs-on: ubuntu-latest
7575
steps:
76-
- uses: actions/checkout@v7
76+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
7777
with:
7878
submodules: recursive
7979
- uses: ./.github/actions/setup
@@ -92,7 +92,7 @@ jobs:
9292
name: Lint
9393
runs-on: ubuntu-latest
9494
steps:
95-
- uses: actions/checkout@v7
95+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
9696
with:
9797
submodules: recursive
9898

@@ -126,7 +126,7 @@ jobs:
126126
name: Versions consistency
127127
runs-on: ubuntu-latest
128128
steps:
129-
- uses: actions/checkout@v7
129+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
130130
with:
131131
submodules: recursive
132132

.github/workflows/copilot-setup-steps.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ jobs:
1919

2020
steps:
2121
- name: Checkout repository
22-
uses: actions/checkout@v7
22+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
2323
- name: Install gh-aw extension
24-
uses: github/gh-aw/actions/setup-cli@v0.83.4
24+
uses: github/gh-aw/actions/setup-cli@bbb8042878459948333b15b66f27113f4b5c1b9a # v0.83.4
2525
with:
2626
version: v0.50.1

.github/workflows/core-ci.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ jobs:
2626
if: runner.os == 'Windows'
2727
run: git config --global core.longpaths true
2828

29-
- uses: actions/checkout@v7
29+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
3030

3131
- uses: ./.github/actions/setup
3232
with:
3333
node-version: ${{ matrix.node-version }}
3434

35-
- uses: actions/setup-dotnet@v6
35+
- uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
3636
with:
3737
dotnet-version: 8.0.x
3838

@@ -50,7 +50,7 @@ jobs:
5050
run: pnpm vitest run --coverage --reporter=default --reporter=github-actions
5151

5252
- name: Upload coverage artifacts
53-
uses: actions/upload-artifact@v7
53+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
5454
if: always()
5555
with:
5656
name: coverage-${{ matrix.os }}-node${{ matrix.node-version }}
@@ -65,7 +65,7 @@ jobs:
6565
runs-on: ubuntu-latest
6666

6767
steps:
68-
- uses: actions/checkout@v7
68+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
6969

7070
- uses: ./.github/actions/setup
7171

@@ -91,7 +91,7 @@ jobs:
9191
DISPLAY: ":99"
9292

9393
steps:
94-
- uses: actions/checkout@v7
94+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
9595

9696
- uses: ./.github/actions/setup
9797
with:
@@ -117,23 +117,23 @@ jobs:
117117
run: pnpm run test:e2e
118118

119119
- name: Upload UI test results
120-
uses: actions/upload-artifact@v7
120+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
121121
if: always()
122122
with:
123123
name: uitestresults-e2e
124124
path: packages/playground-website/test-results/
125125
retention-days: 5
126126

127127
- name: Upload screenshots
128-
uses: actions/upload-artifact@v7
128+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
129129
if: always()
130130
with:
131131
name: screenshots
132132
path: packages/typespec-vscode/temp/images-linux/
133133
retention-days: 5
134134

135135
- name: Upload trace results
136-
uses: actions/upload-artifact@v7
136+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
137137
if: always()
138138
with:
139139
name: trace-results
@@ -148,7 +148,7 @@ jobs:
148148
runs-on: ubuntu-latest
149149

150150
steps:
151-
- uses: actions/checkout@v7
151+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
152152

153153
- name: Build Docker image
154154
run: docker build -f ./docker/Dockerfile .

.github/workflows/dependabot-pnpm-install.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
permissions:
1919
contents: write
2020
steps:
21-
- uses: actions/checkout@v7
21+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
2222
with:
2323
ref: ${{ github.head_ref }}
2424
submodules: recursive

0 commit comments

Comments
 (0)