Skip to content

Commit 0752c53

Browse files
committed
ci: specify persist-credentials for actions/checkout
Explicitly set `persist-credentials: true` for uses of `actions/checkout` where it's needed (when the job does git operations using the stored credentials) and `persist-credentials: false` where the stored credentials are not later used. This reduces the risk of cached credentials accidentally being leaked via artifacts. Signed-off-by: Daniel Hast <hast.daniel@protonmail.com>
1 parent 3049508 commit 0752c53

File tree

8 files changed

+14
-0
lines changed

8 files changed

+14
-0
lines changed

.github/workflows/dev-bump.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
with:
1919
ref: ${{ github.ref_name }}
2020
token: ${{ secrets.PODMANBOT_TOKEN }}
21+
persist-credentials: true
2122
- name: Bump
2223
id: bump
2324
run: |
@@ -93,6 +94,7 @@ jobs:
9394
with:
9495
ref: main
9596
token: ${{ secrets.PODMANBOT_TOKEN }}
97+
persist-credentials: true
9698
- name: Check version on main
9799
id: check
98100
run: |

.github/workflows/first_contrib_cert_generator.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ jobs:
6060
with:
6161
repository: containers/automation
6262
path: automation-repo
63+
persist-credentials: false
6364

6465
# Step 3: Update the HTML file locally
6566
- name: Update HTML file

.github/workflows/mac-pkg.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ jobs:
100100
uses: actions/checkout@v6
101101
with:
102102
ref: ${{steps.getversion.outputs.version}}
103+
persist-credentials: false
103104
- name: Set up Go
104105
# Conditional duplication sucks - GHA doesn't grok YAML anchors/aliases
105106
if: >-

.github/workflows/machine-os-pr.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ jobs:
7474
repository: containers/podman-machine-os
7575
ref: ${{github.base_ref}}
7676
token: ${{secrets.PODMANBOT_TOKEN}}
77+
persist-credentials: true
7778

7879
- name: Bump version
7980
if: steps.getversion.outputs.update == 'true'

.github/workflows/release-artifacts.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ jobs:
103103
uses: actions/checkout@v6
104104
with:
105105
ref: ${{steps.getversion.outputs.version}}
106+
persist-credentials: false
106107

107108
- name: Set up Go
108109
if: >-

.github/workflows/release.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ jobs:
7272
uses: actions/checkout@v6
7373
with:
7474
ref: ${{needs.check.outputs.version}}
75+
persist-credentials: false
7576
- name: Set up Go
7677
uses: actions/setup-go@v6
7778
with:
@@ -109,6 +110,7 @@ jobs:
109110
uses: actions/checkout@v6
110111
with:
111112
ref: ${{needs.check.outputs.version}}
113+
persist-credentials: false
112114
- name: Set up Go
113115
uses: actions/setup-go@v6
114116
with:
@@ -165,6 +167,8 @@ jobs:
165167
Write-Output "version=$version" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
166168
- name: Checkout Podman
167169
uses: actions/checkout@v6
170+
with:
171+
persist-credentials: false
168172
- name: Download Windows zip artifact
169173
uses: actions/download-artifact@v6
170174
- name: Set up Go
@@ -268,6 +272,7 @@ jobs:
268272
uses: actions/checkout@v6
269273
with:
270274
ref: ${{needs.check.outputs.version}}
275+
persist-credentials: false
271276
- name: Get release notes
272277
run: |
273278
ver="$(echo "$VERSION" | sed -e "s/^v//" -e "s/-rc.*//")"

.github/workflows/update-podmanio.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ jobs:
7878
repository: containers/podman.io
7979
ref: refs/heads/main
8080
token: ${{ secrets.PODMANBOT_TOKEN }}
81+
persist-credentials: true
8182

8283
- name: Check version
8384
if: >-

.github/workflows/upload-win-installer.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ jobs:
5555
# installer build script is designed to support older releases (uses the archives
5656
# on the release tag).
5757
- uses: actions/checkout@v6
58+
with:
59+
persist-credentials: false
5860
# This step is super-duper critical for the built/signed windows installer .exe file.
5961
# It ensures the referenced $version github release page does NOT already contain
6062
# this file. Windows assigns a UUID to the installer at build time, it's assumed

0 commit comments

Comments
 (0)