Skip to content

Commit 0f9f778

Browse files
hugovkhynek
andauthored
Attest build provenance of artifacts (#122)
* Attest build provenance of artifacts * Add attest-build-provenance input to changelog * Try out attestation in CI * Clarify this is only GitHub attestation * Revert "Try out attestation in CI" This reverts commit 6a782e1. --------- Co-authored-by: Hynek Schlawack <[email protected]>
1 parent 36b0128 commit 0f9f778

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
## [Unreleased](https://github.com/hynek/build-and-inspect-python-package/compare/v2.4.0...main)
88

9+
### Added
10+
11+
- New input: `attest-build-provenance-github` generates signed build provenance attestations for workflow artifacts.
12+
[#122](https://github.com/hynek/build-and-inspect-python-package/pull/122)
13+
14+
915
## [2.4.0](https://github.com/hynek/build-and-inspect-python-package/compare/v2.3.0...v2.4.0) - 2024-04-11
1016

1117
### Changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ 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-github`: Whether to generate signed build provenance attestations for workflow artifacts using [actions/attest-build-provenance](https://github.com/actions/attest-build-provenance).
99+
Requires `attestations: write` and `id-token: write` permissions.
100+
The only meaningful value is `'true'` (note the quotes – GitHub Actions only allow string inputs) and everything else is treated as falsey.
101+
(*optional*, default: `'false'`).
98102

99103

100104
### 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-github:
23+
description: "Attest provenance using GitHub's own action. 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 GitHub build provenance
110+
if: ${{ inputs.attest-build-provenance-github == '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)