Skip to content

Commit 2324911

Browse files
committed
Attest build provenance of artifacts
1 parent 36b0128 commit 2324911

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,11 @@ While *build-and-inspect-python-package* will build a wheel for you by default,
9595

9696
Use this if you want to build multiple packages in one workflow.
9797
(*optional*, default: `''`).
98+
- `attest-build-provenance`: Whether to generate signed build provenance attestations for workflow artifacts using
99+
[actions/attest-build-provenance](https://github.com/actions/attest-build-provenance).
100+
Requires `attestations: write` and `id-token: write` permissions.
101+
The only meaningful value is `'true'` (note the quotes – GitHub Actions only allow string inputs) and everything else is treated as falsey.
102+
(*optional*, default: `'false'`).
98103

99104

100105
### Outputs

action.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ inputs:
1919
description: Suffix to append to the artifact names.
2020
required: false
2121
default: ""
22+
attest-build-provenance:
23+
description: "Suffix to append to the artifact names. Requires 'attestations: write' and 'id-token: write' permissions."
24+
required: false
25+
default: 'false'
2226
outputs:
2327
dist:
2428
description: The location of the built packages.
@@ -102,6 +106,12 @@ runs:
102106
shell: bash
103107
working-directory: ${{ inputs.path }}
104108

109+
- name: Attest build provenance
110+
if: ${{ inputs.attest-build-provenance == 'true' }}
111+
uses: actions/attest-build-provenance@v1
112+
with:
113+
subject-path: "/tmp/baipp/dist/*"
114+
105115
- name: Set output
106116
id: dist-location-setter
107117
shell: bash

0 commit comments

Comments
 (0)