ci: Do not persist credentials after checkout (#1464)

See actions/checkout#485 and
https://johnstawinski.com/2024/01/11/playing-with-fire-how-we-executed-a-critical-supply-chain-attack-on-pytorch/

In short, it is a terrible idea to persist even our default credentials
after checkout. There's no call for that, so we will now set
`persist-credentials: false` on all checkout actions.
This commit is contained in:
Joey Parrish 2024-12-18 08:25:39 -08:00 committed by GitHub
parent 4e6a79f5d7
commit 57330eda4a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 10 additions and 0 deletions

View File

@ -31,6 +31,7 @@ jobs:
with:
ref: ${{ inputs.ref }}
submodules: recursive
persist-credentials: false
- name: Build
shell: bash

View File

@ -43,6 +43,7 @@ jobs:
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
persist-credentials: false
- name: Generate docs
run: |

View File

@ -47,6 +47,7 @@ jobs:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
persist-credentials: false
- name: Configure Build Matrix
id: configure
@ -99,6 +100,7 @@ jobs:
ref: ${{ inputs.ref }}
submodules: recursive
fetch-tags: true
persist-credentials: false
- name: Install Linux deps
if: runner.os == 'Linux'

View File

@ -33,6 +33,7 @@ jobs:
# We must use 'fetch-depth: 2', or else the linter won't have another
# revision to compare to.
fetch-depth: 2
persist-credentials: false
- name: Lint
shell: bash

View File

@ -48,6 +48,7 @@ jobs:
ref: ${{ inputs.tag }}
submodules: recursive
fetch-tags: true
persist-credentials: false
- name: Log in to Docker Hub
uses: docker/login-action@v3

View File

@ -44,6 +44,7 @@ jobs:
uses: actions/checkout@v4
with:
ref: ${{ inputs.tag }}
persist-credentials: false
- uses: actions/setup-node@v4
with:

View File

@ -55,6 +55,7 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-tags: true
persist-credentials: false
- name: Compute latest
id: compute

View File

@ -32,6 +32,7 @@ jobs:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
persist-credentials: false
- name: Configure Build Matrix
id: configure
@ -69,6 +70,7 @@ jobs:
with:
ref: ${{ inputs.ref }}
submodules: recursive
persist-credentials: false
- name: Build in Docker
run: ./packager/testing/test_dockers.sh "${{ matrix.os_name }}"