Skip to content

Commit 706f36c

Browse files
committed
ci: do not persist checkout credentials
Nothing after checkout in commit-check, coverage, test or used-by needs authenticated git (create-pull-request sets up its own auth for its push), so the token is no longer left in .git/config. release.yaml keeps it: that job pushes the re-created tag.
1 parent d744365 commit 706f36c

4 files changed

Lines changed: 12 additions & 0 deletions

File tree

‎.github/workflows/commit-check.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ jobs:
1919
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
2020
with:
2121
fetch-depth: 0 # Required for merge-base checks
22+
# Nothing after checkout needs authenticated git.
23+
persist-credentials: false
2224
- uses: ./ # self test
2325
with:
2426
message: true

‎.github/workflows/coverage.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
17+
with:
18+
# Nothing after checkout needs authenticated git.
19+
persist-credentials: false
1720
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
1821
with:
1922
# 3.10 is the real floor, see test.yml

‎.github/workflows/test.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ jobs:
2727
runs-on: ${{ matrix.os }}
2828
steps:
2929
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
30+
with:
31+
# Nothing after checkout needs authenticated git.
32+
persist-credentials: false
3033
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
3134
with:
3235
python-version: ${{ matrix.py }}

‎.github/workflows/used-by.yml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
18+
with:
19+
# create-pull-request authenticates its own push, so the token
20+
# is not left in .git/config for the steps in between.
21+
persist-credentials: false
1822
- uses: shenxianpeng/used-by@4c0501cd4b6370c275b50d46400538ae90b8e7a9 # v0.1.5
1923
with:
2024
repo: '${{ github.repository }}'

0 commit comments

Comments
 (0)