Skip to content

Commit 7193aa3

Browse files
committed
Attest PyPI release build provenance
Add GitHub build provenance attestations for plugin and Python client distributions published to PyPI. Assisted By: Codex
1 parent b2a4f2e commit 7193aa3

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

‎CHANGES/+use-actions-attest.misc‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Use `actions/attest` to generate build provenance for published packages.

‎templates/github/.github/workflows/publish.yml.j2‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ jobs:
3737
name: "pypi"
3838
url: "https://pypi.org/p/{{ plugin_name | dash }}"
3939
permissions:
40+
attestations: "write"
41+
contents: "read"
4042
id-token: "write"
4143

4244
steps:
@@ -45,6 +47,11 @@ jobs:
4547
name: "plugin_package"
4648
path: "dist/"
4749

50+
- name: "Attest package build provenance"
51+
uses: "actions/attest@v4"
52+
with:
53+
subject-path: "dist/*"
54+
4855
- name: "Publish package to PyPI"
4956
uses: pypa/gh-action-pypi-publish@release/v1
5057

@@ -59,6 +66,8 @@ jobs:
5966
environment:
6067
name: "pypi"
6168
permissions:
69+
attestations: "write"
70+
contents: "read"
6271
id-token: "write"
6372

6473
steps:
@@ -76,6 +85,11 @@ jobs:
7685
tar -xvf {{ plugin.app_label }}-python-client.tar
7786
{%- endfor %}
7887

88+
- name: "Attest Python client build provenance"
89+
uses: "actions/attest@v4"
90+
with:
91+
subject-path: "{{ plugin_name }}/dist/*"
92+
7993
- name: "Publish client to pypi"
8094
uses: "pypa/gh-action-pypi-publish@release/v1"
8195
with:

0 commit comments

Comments
 (0)