Skip to content

Commit 976aa55

Browse files
committed
ci: set persist-credentials: false on checkout steps
actions/checkout persists the job token into the workspace .git/config by default. These jobs never push or fetch with it, so persisting it only lets a later compromised step in the same job read the token from disk. Setting persist-credentials: false keeps it out of the checkout.
1 parent 10bc170 commit 976aa55

5 files changed

Lines changed: 8 additions & 0 deletions

File tree

.github/workflows/composer-security.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ jobs:
2121
steps:
2222
- name: Checkout code
2323
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
24+
with:
25+
persist-credentials: false
2426

2527
- name: Setup PHP + pinned Composer
2628
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2

.github/workflows/fix-php-code-style-issues.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ jobs:
1717
steps:
1818
- name: Checkout code
1919
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
20+
with:
21+
persist-credentials: false
2022

2123
- name: Check PHP code style (fail on violations, no changes)
2224
uses: aglipanci/laravel-pint-action@36de00d5f5a8a4e12d443e01671daa12a18f4c79 # 2.6

.github/workflows/phpstan.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
1919
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
2020
with:
2121
ref: ${{ github.head_ref }}
22+
persist-credentials: false
2223

2324
- name: Setup PHP
2425
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2

.github/workflows/run-tests.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 code
2929
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
30+
with:
31+
persist-credentials: false
3032

3133
- name: Setup PHP
3234
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2

.github/workflows/update-changelog.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
2323
with:
2424
ref: main
25+
persist-credentials: false
2526

2627
- name: Update Changelog
2728
uses: stefanzweifel/changelog-updater-action@a938690fad7edf25368f37e43a1ed1b34303eb36 # v1

0 commit comments

Comments
 (0)