Skip to content

Commit 4476f72

Browse files
[Github][libc++] Hash Pin Actions in Workflows (#129488)
This patch has pins actions in the libc Github workflows. Hash pinning is a best practice as it ensures we are getting an exact action version, which can help with reproducibility/reliability. It additionally alleviates security concerns as an attacker can modify release assets, potentially giving them access to tokens in privileged workflows.
1 parent b9cb931 commit 4476f72

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

.github/workflows/libcxx-build-and-test.yaml

+8-8
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
cc: 'gcc-14'
5656
cxx: 'g++-14'
5757
steps:
58-
- uses: actions/checkout@v4
58+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
5959
- name: ${{ matrix.config }}.${{ matrix.cxx }}
6060
run: libcxx/utils/ci/run-buildbot ${{ matrix.config }}
6161
env:
@@ -105,7 +105,7 @@ jobs:
105105
cc: 'clang-18'
106106
cxx: 'clang++-18'
107107
steps:
108-
- uses: actions/checkout@v4
108+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
109109
- name: ${{ matrix.config }}
110110
run: libcxx/utils/ci/run-buildbot ${{ matrix.config }}
111111
env:
@@ -169,7 +169,7 @@ jobs:
169169
runs-on: ${{ matrix.machine }}
170170
container: ghcr.io/llvm/libcxx-linux-builder:b319dfef21f6c7b0bc6a356d6b9f41a3b3b98ae9
171171
steps:
172-
- uses: actions/checkout@v4
172+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
173173
- name: ${{ matrix.config }}
174174
run: libcxx/utils/ci/run-buildbot ${{ matrix.config }}
175175
env:
@@ -207,11 +207,11 @@ jobs:
207207
os: macos-13
208208
runs-on: ${{ matrix.os }}
209209
steps:
210-
- uses: actions/checkout@v4
211-
- uses: maxim-lobanov/setup-xcode@v1
210+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
211+
- uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0
212212
with:
213213
xcode-version: 'latest'
214-
- uses: seanmiddleditch/gha-setup-ninja@master
214+
- uses: seanmiddleditch/gha-setup-ninja@3b1f8f94a2f8254bd26914c4ab9474d4f0015f67 # v6
215215
- name: Build and test
216216
run: |
217217
python3 -m venv .venv
@@ -247,7 +247,7 @@ jobs:
247247
- { config: mingw-dll-i686, mingw: true }
248248
- { config: mingw-incomplete-sysroot, mingw: true }
249249
steps:
250-
- uses: actions/checkout@v4
250+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
251251
- name: Install dependencies
252252
run: |
253253
choco install -y ninja
@@ -275,7 +275,7 @@ jobs:
275275
echo "c:\Program Files\Git\usr\bin" | Out-File -FilePath $Env:GITHUB_PATH -Encoding utf8 -Append
276276
- name: Set up the MSVC dev environment
277277
if: ${{ matrix.mingw != true }}
278-
uses: ilammy/msvc-dev-cmd@v1
278+
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
279279
- name: Build and test
280280
run: |
281281
bash libcxx/utils/ci/run-buildbot ${{ matrix.config }}

.github/workflows/libcxx-build-containers.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
packages: write
3333

3434
steps:
35-
- uses: actions/checkout@v4
35+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3636

3737
- name: Build the Linux builder image
3838
working-directory: libcxx/utils/ci
@@ -47,7 +47,7 @@ jobs:
4747
# TAG: ${{ github.sha }}
4848

4949
- name: Log in to GitHub Container Registry
50-
uses: docker/login-action@v3
50+
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
5151
with:
5252
registry: ghcr.io
5353
username: ${{ github.actor }}

.github/workflows/libcxx-check-generated-files.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ jobs:
1212
runs-on: ubuntu-24.04
1313
steps:
1414
- name: Fetch LLVM sources
15-
uses: actions/checkout@v4
15+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1616

1717
- name: Install dependencies
18-
uses: aminya/setup-cpp@v1
18+
uses: aminya/setup-cpp@17c11551771948abc5752bbf3183482567c7caf0 # v1.1.1
1919
with:
2020
clangformat: 17.0.1
2121
ninja: true

0 commit comments

Comments
 (0)