Skip to content

Commit 8a64cae

Browse files
committed
harden ci: move template injections to env vars, only persist github token during checkout where needed and scope secrets in workflow calls
Signed-off-by: Armin Schrenk <armin.schrenk@skymatic.de>
1 parent ebf009e commit 8a64cae

3 files changed

Lines changed: 16 additions & 1 deletion

File tree

‎.github/workflows/build.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ jobs:
2323
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
2424
steps:
2525
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
26+
with:
27+
persist-credentials: false
2628
- uses: graalvm/setup-graalvm@27b360dbb857524eaf0b4c4cef364d38e5b4f173 # v1.6.7
2729
with:
2830
java-version: ${{ env.JAVA_VERSION }}

‎.github/workflows/draft-release.yml‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
2525
with:
2626
fetch-depth: 0
27+
persist-credentials: false
2728
- name: Check the git tag is signed
2829
run: git cat-file -p "${GITHUB_REF_NAME}" | grep "BEGIN SSH SIGNATURE"
2930
- name: Check the git tag is on main or release branch
@@ -52,7 +53,10 @@ jobs:
5253
with:
5354
version: ${{ github.ref_name }}
5455
upload-to-draft: true
55-
secrets: inherit
56+
secrets:
57+
RELEASES_GPG_PRIVATE_KEY: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }}
58+
RELEASES_GPG_PASSPHRASE: ${{ secrets.RELEASES_GPG_PASSPHRASE }}
59+
CRYPTOBOT_RELEASE_TOKEN: ${{ secrets.CRYPTOBOT_RELEASE_TOKEN }}
5660

5761
update-sha256sums:
5862
name: Update checksums in release body

‎.github/workflows/native-image.yml‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ on:
2222
sha256-completion:
2323
description: 'SHA256 sum of the shell completion script'
2424
value: ${{ jobs.build.outputs.sha256-completion }}
25+
secrets:
26+
RELEASES_GPG_PRIVATE_KEY:
27+
required: true
28+
RELEASES_GPG_PASSPHRASE:
29+
required: true
30+
CRYPTOBOT_RELEASE_TOKEN:
31+
required: false
2532

2633
env:
2734
JAVA_DIST: 'graalvm'
@@ -43,6 +50,8 @@ jobs:
4350
sha256-completion: ${{ steps.sha256sum.outputs.completion }}
4451
steps:
4552
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
53+
with:
54+
persist-credentials: false
4655
- uses: graalvm/setup-graalvm@27b360dbb857524eaf0b4c4cef364d38e5b4f173 # v1.6.7
4756
with:
4857
java-version: ${{ env.JAVA_VERSION }}

0 commit comments

Comments
 (0)