Skip to content

Commit 9d76802

Browse files
committed
harden ci: only persist github token during checkout where needed
Signed-off-by: Armin Schrenk <armin.schrenk@skymatic.de>
1 parent fc1a6f7 commit 9d76802

3 files changed

Lines changed: 9 additions & 0 deletions

File tree

‎.github/workflows/build.yml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ jobs:
1818
artifact-metadata: write # Required for the attestations step
1919
steps:
2020
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
21+
with:
22+
persist-credentials: false
2123
- uses: actions/setup-java@b843ebf9b913146b38da2eaa7aeddf76074ae1ad # v6.1.0
2224
with:
2325
distribution: 'temurin'
@@ -49,6 +51,8 @@ jobs:
4951
if: github.repository_owner == 'cryptomator' && (startsWith(github.ref, 'refs/tags/') || contains(github.event.head_commit.message, '[deploy]'))
5052
steps:
5153
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
54+
with:
55+
persist-credentials: false
5256
- uses: actions/setup-java@b843ebf9b913146b38da2eaa7aeddf76074ae1ad # v6.1.0
5357
with:
5458
distribution: 'temurin'
@@ -85,6 +89,8 @@ jobs:
8589
if: github.repository_owner == 'cryptomator' && (startsWith(github.ref, 'refs/tags/') || contains(github.event.head_commit.message, '[deploy]'))
8690
steps:
8791
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
92+
with:
93+
persist-credentials: false
8894
- uses: actions/setup-java@b843ebf9b913146b38da2eaa7aeddf76074ae1ad # v6.1.0
8995
with:
9096
java-version: ${{ env.JAVA_VERSION }}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ jobs:
2323
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
2424
with:
2525
fetch-depth: 2
26+
persist-credentials: false
2627
- uses: actions/setup-java@b843ebf9b913146b38da2eaa7aeddf76074ae1ad # v6.1.0
2728
with:
2829
distribution: 'temurin'

‎.github/workflows/pullrequest.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ jobs:
2020
runs-on: ubuntu-latest
2121
steps:
2222
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
23+
with:
24+
persist-credentials: false
2325
- uses: actions/setup-java@b843ebf9b913146b38da2eaa7aeddf76074ae1ad # v6.1.0
2426
with:
2527
distribution: ${{ env.JAVA_DIST }}

0 commit comments

Comments
 (0)