Skip to content

Commit 5c93489

Browse files
committed
Do not leave the checkout's token in .git/config
zizmor's artipacked audit flagged 13 actions/checkout steps that keep the GITHUB_TOKEN in the repository's .git/config for the rest of the job, where every later step can read it, and an artifact that uploads the checkout would carry it. No job here pushes with git: the release attaches to a tag that is already pushed (skipTag), and the draft release, the dependency graph and the CodeQL results go through the API with their own tokens. Every checkout now sets persist-credentials: false, as the one in zizmor.yml already did.
1 parent e496bdc commit 5c93489

5 files changed

Lines changed: 20 additions & 0 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ jobs:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
22+
with:
23+
persist-credentials: false
2224

2325
- name: Install JDK 21
2426
uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1
@@ -63,6 +65,8 @@ jobs:
6365
out until the wrapper's Gradle supports Java 27.
6466
steps:
6567
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
68+
with:
69+
persist-credentials: false
6670

6771
- name: Install JDK ${{ matrix.jdk }} for the tests
6872
id: test-jdk
@@ -126,6 +130,8 @@ jobs:
126130

127131
steps:
128132
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
133+
with:
134+
persist-credentials: false
129135

130136
# The jars compile with a Java 21 toolchain, which gradle.properties looks up in JDK21_HOME. On
131137
# Linux and macOS Gradle also finds the runner's own JDK 21 by its location, on Windows it does not.

‎.github/workflows/codeql-analysis.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ jobs:
2727
steps:
2828
- name: Checkout repository
2929
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
30+
with:
31+
persist-credentials: false
3032

3133
- name: Set up JDK 21
3234
uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1

‎.github/workflows/dependency-submission.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
15+
with:
16+
persist-credentials: false
1517

1618
- name: Set up a bootstrap JDK
1719
uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1

‎.github/workflows/release.yml‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ jobs:
3939
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
4040
with:
4141
fetch-depth: 0
42+
persist-credentials: false
4243

4344
- name: Install JDK 21
4445
uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1
@@ -100,6 +101,8 @@ jobs:
100101

101102
steps:
102103
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
104+
with:
105+
persist-credentials: false
103106

104107
# The Java 21 toolchain for the jars, through JDK21_HOME, as in ci.yml: Gradle does not find the
105108
# runner's own JDK 21 on Windows. Installed before GraalVM, so that Gradle still runs on GraalVM.
@@ -143,6 +146,7 @@ jobs:
143146
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
144147
with:
145148
fetch-depth: 0
149+
persist-credentials: false
146150

147151
- name: Install JDK 21
148152
uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1
@@ -207,6 +211,7 @@ jobs:
207211
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
208212
with:
209213
fetch-depth: 0
214+
persist-credentials: false
210215

211216
- name: Install JDK 21
212217
uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1
@@ -244,6 +249,7 @@ jobs:
244249
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
245250
with:
246251
fetch-depth: 0
252+
persist-credentials: false
247253

248254
- name: Install JDK 21
249255
uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1
@@ -286,6 +292,7 @@ jobs:
286292
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
287293
with:
288294
fetch-depth: 0
295+
persist-credentials: false
289296

290297
- name: Install JDK 21
291298
uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1
@@ -325,6 +332,7 @@ jobs:
325332
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
326333
with:
327334
fetch-depth: 0
335+
persist-credentials: false
328336

329337
- name: Install JDK 21
330338
uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1

‎.github/workflows/sha-pinning-check.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
14+
with:
15+
persist-credentials: false
1416

1517
- uses: zgosalvez/github-actions-ensure-sha-pinned-actions@62574f011e0d1967d555a862bd28a7abba8684fe # v5.0.9

0 commit comments

Comments
 (0)