Skip to content

Commit 521ba8b

Browse files
committed
Fix release workflow
Signed-off-by: Matheus Pimenta <[email protected]>
1 parent 094a3a1 commit 521ba8b

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

.github/workflows/release.yaml

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,14 @@ jobs:
2525
release-provenance:
2626
needs: [release]
2727
permissions:
28-
actions: read # To read the workflow path.
29-
id-token: write # To sign the provenance.
30-
contents: write # To add assets to the release.
28+
actions: read # for detecting the Github Actions environment.
29+
id-token: write # for creating OIDC tokens for signing.
30+
contents: write # for uploading attestations to GitHub releases.
31+
if: startsWith(github.ref, 'refs/tags/v')
3132
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected]
3233
with:
3334
provenance-name: "provenance.intoto.jsonl"
34-
base64-subjects: "${{ needs.release.outputs.hashes }}"
35+
base64-subjects: "${{ needs.release.outputs.release-digests }}"
3536
upload-assets: true
3637
dockerhub-provenance:
3738
needs: [release]
@@ -40,11 +41,12 @@ jobs:
4041
actions: read # for detecting the Github Actions environment.
4142
id-token: write # for creating OIDC tokens for signing.
4243
packages: write # for uploading attestations.
44+
if: startsWith(github.ref, 'refs/tags/v')
4345
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected]
4446
with:
45-
image: ${{ needs.release.outputs.image_url }}
46-
digest: ${{ needs.release.outputs.image_digest }}
47-
registry-username: fluxcdbot
47+
image: ${{ needs.release.outputs.image-name }}
48+
digest: ${{ needs.release.outputs.image-digest }}
49+
registry-username: ${{ github.repository_owner == 'fluxcd' && 'fluxcdbot' || github.repository_owner }}
4850
secrets:
4951
registry-password: ${{ secrets.DOCKER_FLUXCD_PASSWORD }}
5052
ghcr-provenance:
@@ -54,10 +56,11 @@ jobs:
5456
actions: read # for detecting the Github Actions environment.
5557
id-token: write # for creating OIDC tokens for signing.
5658
packages: write # for uploading attestations.
59+
if: startsWith(github.ref, 'refs/tags/v')
5760
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected]
5861
with:
59-
image: ghcr.io/${{ needs.release.outputs.image_url }}
60-
digest: ${{ needs.release.outputs.image_digest }}
61-
registry-username: fluxcdbot
62+
image: ghcr.io/${{ needs.release.outputs.image-name }}
63+
digest: ${{ needs.release.outputs.image-digest }}
64+
registry-username: fluxcdbot # not necessary for ghcr.io
6265
secrets:
63-
registry-password: ${{ secrets.GHCR_TOKEN }}
66+
registry-password: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)