Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attest build provenance of artifacts #122

Merged
merged 5 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

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

### Added

- New input: `attest-build-provenance-github` generates signed build provenance attestations for workflow artifacts.
[#122](https://github.com/hynek/build-and-inspect-python-package/pull/122)


## [2.4.0](https://github.com/hynek/build-and-inspect-python-package/compare/v2.3.0...v2.4.0) - 2024-04-11

### Changed
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ While *build-and-inspect-python-package* will build a wheel for you by default,

Use this if you want to build multiple packages in one workflow.
(*optional*, default: `''`).
- `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).
Requires `attestations: write` and `id-token: write` permissions.
The only meaningful value is `'true'` (note the quotes – GitHub Actions only allow string inputs) and everything else is treated as falsey.
(*optional*, default: `'false'`).


### Outputs
Expand Down
10 changes: 10 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ inputs:
description: Suffix to append to the artifact names.
required: false
default: ""
attest-build-provenance-github:
description: "Attest provenance using GitHub's own action. Requires 'attestations: write' and 'id-token: write' permissions."
required: false
default: 'false'
outputs:
dist:
description: The location of the built packages.
Expand Down Expand Up @@ -102,6 +106,12 @@ runs:
shell: bash
working-directory: ${{ inputs.path }}

- name: Attest GitHub build provenance
if: ${{ inputs.attest-build-provenance-github == 'true' }}
uses: actions/attest-build-provenance@v1
with:
subject-path: "/tmp/baipp/dist/*"

- name: Set output
id: dist-location-setter
shell: bash
Expand Down