Skip to content

Commit a4709d5

Browse files
authored
ci(security): avoid persisting credentials on checkout (#24)
1 parent 4ae2af3 commit a4709d5

8 files changed

Lines changed: 23 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ jobs:
2828
steps:
2929
- name: Checkout the repository
3030
uses: actions/checkout@v4
31+
with:
32+
persist-credentials: 'false'
3133
- name: Bootstrap repository
3234
uses: ./.github/actions/bootstrap
3335
with:
@@ -47,13 +49,15 @@ jobs:
4749
if: github.event_name != 'pull_request'
4850
with:
4951
fetch-depth: 0
52+
persist-credentials: 'false'
5053
- name: Checkout the repository
5154
uses: actions/checkout@v4
5255
# Necessary for hooks to succeed during tests for PRs
5356
if: github.event_name == 'pull_request'
5457
with:
5558
ref: ${{ github.event.pull_request.head.ref }}
5659
fetch-depth: 0
60+
persist-credentials: 'false'
5761
- name: Bootstrap repository
5862
uses: ./.github/actions/bootstrap
5963
with:

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
with:
2727
fetch-depth: 0
2828
token: ${{ secrets.GITHUB_TOKEN }}
29+
persist-credentials: 'false'
2930

3031
- name: Bootstrap repository
3132
uses: ./.github/actions/bootstrap

.github/workflows/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 the repository
2323
uses: actions/checkout@v4
24+
with:
25+
persist-credentials: 'false'
2426
- name: Bootstrap repository
2527
uses: ./.github/actions/bootstrap
2628
with:

.github/workflows/update.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ jobs:
2323
steps:
2424
- name: Checkout the repository
2525
uses: actions/checkout@v4
26+
with:
27+
persist-credentials: 'false'
2628
- name: Bootstrap repository
2729
uses: ./.github/actions/bootstrap
2830
with:

{{cookiecutter.project_name|replace(" ", "")}}/.github/workflows/ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ jobs:
2424
steps:
2525
- name: Checkout the repository
2626
uses: actions/checkout@v4
27+
with:
28+
persist-credentials: 'false'
2729
- name: Bootstrap repository
2830
uses: ./.github/actions/bootstrap
2931
with:
@@ -49,6 +51,8 @@ jobs:
4951
steps:
5052
- name: Checkout the repository
5153
uses: actions/checkout@v4
54+
with:
55+
persist-credentials: 'false'
5256
- name: Bootstrap repository
5357
uses: ./.github/actions/bootstrap
5458
with:
@@ -69,6 +73,8 @@ jobs:
6973
steps:
7074
- name: Checkout code
7175
uses: actions/checkout@v4
76+
with:
77+
persist-credentials: 'false'
7278
- name: Bootstrap repository
7379
uses: ./.github/actions/bootstrap
7480
with:

{{cookiecutter.project_name|replace(" ", "")}}/.github/workflows/commit.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ jobs:
2020
steps:
2121
- name: Checkout the repository
2222
uses: actions/checkout@v4
23+
with:
24+
persist-credentials: 'false'
2325
- name: Bootstrap repository
2426
uses: ./.github/actions/bootstrap
2527
with:
@@ -41,6 +43,7 @@ jobs:
4143
uses: actions/checkout@v4
4244
with:
4345
fetch-depth: 0
46+
persist-credentials: 'false'
4447
- name: Bootstrap repository
4548
uses: ./.github/actions/bootstrap
4649
with:
@@ -116,6 +119,7 @@ jobs:
116119
with:
117120
fetch-depth: 0
118121
ref: "${{ "{{ needs.bump-version.outputs.tag }}" }}"
122+
persist-credentials: 'false'
119123
- name: Bootstrap repository
120124
uses: ./.github/actions/bootstrap
121125
with:

{{cookiecutter.project_name|replace(" ", "")}}/.github/workflows/security.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ jobs:
3131
steps:
3232
- name: Checkout the repository
3333
uses: actions/checkout@v4
34+
with:
35+
persist-credentials: 'false'
3436
- name: Bootstrap repository
3537
uses: ./.github/actions/bootstrap
3638
with:

{{cookiecutter.project_name|replace(" ", "")}}/.github/workflows/update.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ jobs:
2323
steps:
2424
- name: Checkout the repository
2525
uses: actions/checkout@v4
26+
with:
27+
persist-credentials: 'false'
2628
- name: Bootstrap repository
2729
uses: ./.github/actions/bootstrap
2830
with:

0 commit comments

Comments
 (0)