Skip to content

Commit 4cb4cd2

Browse files
committed
fix: add attestations (#4)
1 parent c7223ff commit 4cb4cd2

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

.github/workflows/release.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ jobs:
1313
permissions:
1414
contents: write
1515
actions: write
16+
id-token: write
17+
attestations: write
1618
steps:
1719
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
1820
with:
@@ -33,27 +35,29 @@ jobs:
3335
run: echo "name=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
3436
- name: Release
3537
id: release
36-
uses: google-github-actions/release-please-action@e4dc86ba9405554aeba3c6bb2d169500e7d3b4ee # v4.1.1
38+
uses: googleapis/release-please-action@7987652d64b4581673a76e33ad5e98e3dd56832f # v4.1.3
3739
with:
3840
target-branch: ${{ steps.branch.outputs.name }}
3941
release-type: terraform-module
4042
token: ${{ steps.token.outputs.token }}
4143
- name: Attest
42-
if: ${{ steps.release.outputs.releases_created == 'true' }}
4344
id: attest
4445
uses: actions/attest-build-provenance@7668571508540a607bdfd90a87a560489fe372eb # v2.1.0
4546
with:
46-
subject-path: '${{ github.workspace }}/lambdas/functions/**/*.zip'
47+
subject-path: '${{ github.workspace }}/**/dist/*.zip'
48+
- name: ouptut attestation
49+
run: |
50+
echo "Attestation bundle: ${{ steps.attest.outputs.bundle-path }}"
51+
echo "Attestation id: ${{ steps.attest.outputs.attestation-id }}"
52+
echo "Attestation url: ${{ steps.attest.outputs.attestation-url }}"
4753
- name: Update release notes with attestation
48-
if: ${{ steps.release.outputs.releases_created == 'true' }}
49-
env:
50-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54+
if: github.event_name == 'workflow_dispatch'
5155
run: |
52-
gh release view ${{ steps.release.outputs.tag_name }} --json body -q '.body' > new-release-notes.md
56+
gh release view ${{ github.event.inputs.version }} --json body -q '.body' > new-release-notes.md
5357
echo "## Attestation" >> new-release-notes.md
5458
echo "Attestation url: ${{ steps.attest.outputs.attestation-url }}" >> new-release-notes.md
5559
echo "You can verify the artifacts by running \`gh attest verify <name of artifact> --repo npalm/atterstation-test\`" >> new-release-notes.md
56-
gh release edit ${{ steps.release.outputs.tag_name }} -F new-release-notes.md -t ${{ steps.release.outputs.tag_name }}
60+
gh release edit ${{ github.event.inputs.version }} -F new-release-notes.md -t ${{ github.event.inputs.version }}
5761
- name: Upload Release Assets
5862
if: ${{ steps.release.outputs.releases_created == 'true' }}
5963
env:

0 commit comments

Comments
 (0)