Skip to content

Commit 03c76b4

Browse files
committed
chore(.github/workflows/release.yml): add custom SLSA provenance and SPDX file upload to release workflow
Signed-off-by: Gaius <gaius.qi@gmail.com>
1 parent efb7c75 commit 03c76b4

File tree

1 file changed

+30
-6
lines changed

1 file changed

+30
-6
lines changed

.github/workflows/release.yml

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,36 @@ jobs:
6464
provenance:
6565
needs: [goreleaser]
6666
permissions:
67-
actions: read # To read the workflow path.
68-
id-token: write # To sign the provenance.
69-
contents: write # To add assets to a release.
67+
id-token: write
68+
contents: write
69+
actions: read
7070
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v2.1.0
7171
with:
7272
base64-subjects: "${{ needs.goreleaser.outputs.hashes }}"
73-
upload-tag-name: "${{ needs.goreleaser.outputs.tag_name }}"
74-
upload-assets: true # upload to a new release
75-
draft-release: true
73+
74+
upload-provenance:
75+
needs: [goreleaser, provenance]
76+
permissions:
77+
contents: write
78+
runs-on: ubuntu-latest
79+
steps:
80+
- name: Checkout
81+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
82+
with:
83+
fetch-depth: 0
84+
submodules: recursive
85+
86+
- name: Download SLSA provenance artifacts
87+
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1
88+
with:
89+
name: multiple.intoto.jsonl
90+
path: artifacts
91+
92+
- name: Upload SLSA Provenance Attestation to Release
93+
env:
94+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
95+
TAG_NAME: ${{ needs.goreleaser.outputs.tag_name }}
96+
run: |
97+
set -euxo pipefail
98+
ARTIFACT_PATH="artifacts/multiple.intoto.jsonl"
99+
gh release upload "$TAG_NAME" "$ARTIFACT_PATH" --clobber

0 commit comments

Comments
 (0)