Skip to content

Commit 78fbb5f

Browse files
committed
Pin to SHA for actions outside of PyTorch
Pin actions from repos external to the PyTorch project to their shasums for security. This is a best practice as Git tags are not immutable. https://openssf.org/blog/2024/08/12/mitigating-attack-vectors-in-github-workflows/ Signed-off-by: Thanh Ha <[email protected]>
1 parent ac6c4f2 commit 78fbb5f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+158
-158
lines changed

.github/workflows/_binary_upload.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
timeout-minutes: 30
5252
name: upload-${{ matrix.build_name }}
5353
steps:
54-
- uses: actions/checkout@v4
54+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
5555
with:
5656
repository: ${{ inputs.test-infra-repository }}
5757
ref: ${{ inputs.test-infra-ref }}
@@ -70,21 +70,21 @@ jobs:
7070
upload-to-base-bucket: ${{ matrix.upload_to_base_bucket }}
7171

7272
- name: Download the artifact
73-
uses: actions/download-artifact@v4
73+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
7474
with:
7575
name: ${{ env.ARTIFACT_NAME }}
7676
path: ${{ inputs.repository }}/dist/
7777

7878
- name: Configure aws credentials (pytorch account)
7979
if: ${{ inputs.trigger-event == 'schedule' || (inputs.trigger-event == 'push' && startsWith(github.event.ref, 'refs/heads/nightly')) }}
80-
uses: aws-actions/configure-aws-credentials@v3
80+
uses: aws-actions/configure-aws-credentials@50ac8dd1e1b10d09dac7b8727528b91bed831ac0 # v3.0.2
8181
with:
8282
role-to-assume: arn:aws:iam::749337293305:role/gha_workflow_nightly_build_wheels
8383
aws-region: us-east-1
8484

8585
- name: Configure aws credentials (pytorch account)
8686
if: ${{ env.CHANNEL == 'test' && startsWith(github.event.ref, 'refs/tags/v') }}
87-
uses: aws-actions/configure-aws-credentials@v3
87+
uses: aws-actions/configure-aws-credentials@50ac8dd1e1b10d09dac7b8727528b91bed831ac0 # v3.0.2
8888
with:
8989
role-to-assume: arn:aws:iam::749337293305:role/gha_workflow_test_build_wheels
9090
aws-region: us-east-1
@@ -120,7 +120,7 @@ jobs:
120120
121121
- name: Upload package to pypi
122122
if: ${{ env.NIGHTLY_OR_TEST == '1' && contains(inputs.upload-to-pypi, matrix.desired_cuda) }}
123-
uses: pypa/gh-action-pypi-publish@release/v1
123+
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # release/v1
124124
with:
125125
user: __token__
126126
password: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/_upload_docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ jobs:
2626
if: ${{ github.repository == inputs.repository && github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) }}
2727
steps:
2828
- name: Checkout
29-
uses: actions/checkout@v4
29+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3030
with:
3131
ref: ${{ inputs.docs-branch }}
3232
persist-credentials: true
3333
- name: Download artifact
34-
uses: actions/download-artifact@v4
34+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
3535
with:
3636
name: ${{ inputs.docs-name }}
3737
path: docs

.github/workflows/backfill-workflow-job.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ jobs:
1717
runs-on: ubuntu-24.04
1818
steps:
1919
- name: configure aws credentials
20-
uses: aws-actions/[email protected]
20+
uses: aws-actions/configure-aws-credentials@67fbcbb121271f7775d2e7715933280b06314838 # v1.7.0
2121
with:
2222
role-to-assume: arn:aws:iam::308535385114:role/gha_workflow_backfill-workflow-job
2323
aws-region: us-east-1
24-
- uses: actions/checkout@v4
24+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2525
- run: yarn install --frozen-lockfile
2626
- run: yarn node scripts/backfillJobs.mjs
2727
env:

.github/workflows/build-windows-ami.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,19 @@ jobs:
2424
runs-on: ubuntu-latest
2525
environment: packer-build-env
2626
steps:
27-
- uses: actions/checkout@v4
27+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2828
with:
2929
repository: pytorch/test-infra
3030
ref: ${{ inputs.branch }}
3131

3232
- name: Configure AWS Credentials (PyTorch Account)
33-
uses: aws-actions/configure-aws-credentials@v3
33+
uses: aws-actions/configure-aws-credentials@50ac8dd1e1b10d09dac7b8727528b91bed831ac0 # v3.0.2
3434
with:
3535
aws-region: us-east-1
3636
role-to-assume: arn:aws:iam::391835788720:role/gha-packer-role
3737

3838
- name: Setup Packer
39-
uses: hashicorp/setup-packer@main
39+
uses: hashicorp/setup-packer@76e3039aa951aa4e6efe7e6ee06bc9ceb072142d # main
4040
with:
4141
version: ${{ env.PACKER_VERSION }}
4242

.github/workflows/build_wheels_linux.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ jobs:
149149
fi
150150
echo "::endgroup::"
151151
152-
- uses: actions/checkout@v4
152+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
153153
with:
154154
# Support the use case where we need to checkout someone's fork
155155
repository: ${{ inputs.test-infra-repository }}
@@ -307,7 +307,7 @@ jobs:
307307

308308
- name: Upload wheel to GitHub
309309
continue-on-error: true
310-
uses: actions/upload-artifact@v4
310+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
311311
with:
312312
name: ${{ env.ARTIFACT_NAME }}
313313
path: ${{ inputs.repository }}/dist/

.github/workflows/build_wheels_macos.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ jobs:
117117
rm -rfv "${GITHUB_WORKSPACE}"
118118
mkdir -p "${GITHUB_WORKSPACE}"
119119
echo "::endgroup::"
120-
- uses: actions/checkout@v4
120+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
121121
with:
122122
# Support the use case where we need to checkout someone's fork
123123
repository: ${{ inputs.test-infra-repository }}
@@ -252,7 +252,7 @@ jobs:
252252
# NB: Only upload to GitHub after passing smoke tests
253253
- name: Upload wheel to GitHub
254254
continue-on-error: true
255-
uses: actions/upload-artifact@v4
255+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
256256
with:
257257
name: ${{ env.ARTIFACT_NAME }}
258258
path: ${{ inputs.repository }}/dist/

.github/workflows/build_wheels_windows.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ jobs:
9494
# to have a conversation
9595
timeout-minutes: ${{ inputs.timeout }}
9696
steps:
97-
- uses: actions/checkout@v4
97+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
9898
with:
9999
# Support the use case where we need to checkout someone's fork
100100
repository: ${{ inputs.test-infra-repository }}
@@ -212,7 +212,7 @@ jobs:
212212
# NB: Only upload to GitHub after passing smoke tests
213213
- name: Upload wheel to GitHub
214214
continue-on-error: true
215-
uses: actions/upload-artifact@v4
215+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
216216
with:
217217
name: ${{ env.ARTIFACT_NAME }}
218218
path: ${{ inputs.repository }}/dist/

.github/workflows/check-alerts.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
issues: write
4242
steps:
4343
- name: Checkout
44-
uses: actions/checkout@v4
44+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4545
- name: Install Dependencies
4646
run: pip3 install requests setuptools==61.2.0
4747
- name: Check for alerts and creates issue
@@ -60,7 +60,7 @@ jobs:
6060
issues: write
6161
steps:
6262
- name: Checkout
63-
uses: actions/checkout@v4
63+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
6464
- name: Install Dependencies
6565
run: pip3 install requests setuptools==61.2.0
6666
- name: Check for alerts and creates issue

.github/workflows/clang-tidy-linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
runs-on: linux.12xlarge
2323
steps:
2424
- name: Checkout
25-
uses: actions/checkout@v4
25+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2626

2727
- name: Build docker image and extract binary
2828
run: |

.github/workflows/clang-tidy-macos.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
runs-on: macos-13
2525
steps:
2626
- name: Checkout
27-
uses: actions/checkout@v4
27+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2828
- name: Install dependencies
2929
run: |
3030
brew install ninja
@@ -57,7 +57,7 @@ jobs:
5757
runs-on: macos-m1-stable
5858
steps:
5959
- name: Checkout
60-
uses: actions/checkout@v4
60+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
6161
- name: Install dependencies
6262
run: |
6363
brew install ninja cmake

.github/workflows/clickhouse-replicator-dynamo-lambda.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ jobs:
1919
id-token: write
2020
contents: read
2121
steps:
22-
- uses: actions/checkout@v4
23-
- uses: actions/setup-python@v5
22+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
23+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
2424
with:
2525
python-version: '3.12'
2626
cache: pip
2727
- name: configure aws credentials
28-
uses: aws-actions/[email protected]
28+
uses: aws-actions/configure-aws-credentials@67fbcbb121271f7775d2e7715933280b06314838 # v1.7.0
2929
with:
3030
role-to-assume: arn:aws:iam::308535385114:role/gha_deploy_clickhouse_replicator_lambdas
3131
aws-region: us-east-1

.github/workflows/clickhouse-replicator-s3-lambda.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ jobs:
1919
id-token: write
2020
contents: read
2121
steps:
22-
- uses: actions/checkout@v4
23-
- uses: actions/setup-python@v5
22+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
23+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
2424
with:
2525
python-version: '3.12'
2626
cache: pip
2727
- name: configure aws credentials
28-
uses: aws-actions/[email protected]
28+
uses: aws-actions/configure-aws-credentials@67fbcbb121271f7775d2e7715933280b06314838 # v1.7.0
2929
with:
3030
role-to-assume: arn:aws:iam::308535385114:role/gha_deploy_clickhouse_replicator_lambdas
3131
aws-region: us-east-1

.github/workflows/deploy_lambda_whl_metadata_upload_pep658.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ jobs:
1919
test:
2020
runs-on: ubuntu-22.04
2121
steps:
22-
- uses: actions/checkout@v4
23-
- uses: actions/setup-python@v5
22+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
23+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
2424
with:
2525
python-version: '3.13'
2626
cache: pip
@@ -35,13 +35,13 @@ jobs:
3535
id-token: write
3636
contents: read
3737
steps:
38-
- uses: actions/checkout@v4
39-
- uses: actions/setup-python@v5
38+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
39+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
4040
with:
4141
python-version: '3.13'
4242
cache: pip
4343
- name: configure aws credentials
44-
uses: aws-actions/[email protected]
44+
uses: aws-actions/configure-aws-credentials@67fbcbb121271f7775d2e7715933280b06314838 # v1.7.0
4545
with:
4646
role-to-assume: arn:aws:iam::749337293305:role/gha_workflow_whl_metadata_upload_pep658
4747
aws-region: us-east-1

.github/workflows/generate_binary_build_matrix.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@ jobs:
7171
matrix: ${{ steps.generate.outputs.matrix }}
7272
runs-on: ubuntu-latest
7373
steps:
74-
- uses: actions/setup-python@v5
74+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
7575
with:
7676
python-version: '3.10'
7777
- name: Checkout test-infra repository
78-
uses: actions/checkout@v4
78+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
7979
with:
8080
repository: ${{ inputs.test-infra-repository }}
8181
ref: ${{ inputs.test-infra-ref }}

.github/workflows/generate_docker_release_matrix.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ jobs:
3131
matrix: ${{ steps.generate.outputs.matrix }}
3232
runs-on: ubuntu-latest
3333
steps:
34-
- uses: actions/setup-python@v5
34+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
3535
with:
3636
python-version: '3.10'
3737
- name: Checkout test-infra repository
38-
uses: actions/checkout@v4
38+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3939
with:
4040
repository: ${{ inputs.test-infra-repository }}
4141
ref: ${{ inputs.test-infra-ref }}

.github/workflows/generate_release_matrix.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ jobs:
2626
matrix: ${{ steps.generate.outputs.matrix }}
2727
runs-on: ubuntu-latest
2828
steps:
29-
- uses: actions/setup-python@v5
29+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
3030
with:
3131
python-version: '3.10'
3232
- name: Checkout test-infra repository
33-
uses: actions/checkout@v4
33+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3434
with:
3535
repository: ${{ inputs.test-infra-repository }}
3636
ref: ${{ inputs.test-infra-ref }}

.github/workflows/gha-artifacts-lambda.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ jobs:
2424
test:
2525
runs-on: ubuntu-22.04
2626
steps:
27-
- uses: actions/checkout@v4
28-
- uses: actions/setup-python@v5
27+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
28+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
2929
with:
3030
python-version: '3.12'
3131
cache: pip
@@ -36,13 +36,13 @@ jobs:
3636
runs-on: ubuntu-22.04
3737
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
3838
steps:
39-
- uses: actions/checkout@v4
40-
- uses: actions/setup-python@v5
39+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
40+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
4141
with:
4242
python-version: '3.12'
4343
cache: pip
4444
- name: configure aws credentials
45-
uses: aws-actions/[email protected]
45+
uses: aws-actions/configure-aws-credentials@67fbcbb121271f7775d2e7715933280b06314838 # v1.7.0
4646
with:
4747
role-to-assume: arn:aws:iam::308535385114:role/gha_workflow_gha-artifacts-lambda
4848
aws-region: us-east-1

.github/workflows/github-status-test-lambda.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,18 @@ jobs:
2525
contents: read
2626
steps:
2727
- name: configure aws credentials
28-
uses: aws-actions/[email protected]
28+
uses: aws-actions/configure-aws-credentials@67fbcbb121271f7775d2e7715933280b06314838 # v1.7.0
2929
with:
3030
role-to-assume: arn:aws:iam::308535385114:role/gha_workflow_github-status-test-lambda
3131
aws-region: us-east-1
3232

3333
- name: Check out test infra
34-
uses: actions/checkout@v4
34+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3535

3636
- name: Setup python
37-
uses: actions/setup-python@v5
37+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
3838

39-
- uses: nick-fields/retry@3e91a01664abd3c5cd539100d10d33b9c5b68482
39+
- uses: nick-fields/retry@3e91a01664abd3c5cd539100d10d33b9c5b68482 # v2.8.2
4040
name: Setup dependencies
4141
with:
4242
shell: bash

0 commit comments

Comments
 (0)