Skip to content
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
1 change: 1 addition & 0 deletions CHANGES/+use-actions-attest.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use `actions/attest` to generate build provenance for published packages.
14 changes: 14 additions & 0 deletions templates/github/.github/workflows/publish.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ jobs:
name: "pypi"
url: "https://pypi.org/p/{{ plugin_name | dash }}"
permissions:
attestations: "write"
contents: "read"
id-token: "write"

steps:
Expand All @@ -45,6 +47,11 @@ jobs:
name: "plugin_package"
path: "dist/"

- name: "Attest package build provenance"
uses: "actions/attest@v4"
with:
subject-path: "dist/*"

Comment on lines +50 to +54

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this producing files in "dist/"? Can we maybe move this to the build workflow to not sign something that we uploaded as an artifact and downloaded on another worker already?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had the same thought but I think it ultimately doesn't matter much as long as the artifacts are the same as what is uploaded.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, that is my worry in a nutshell. We don't know nothing can temper artifacts created by one workflow before they are downloaded again.
And adding it this way could be creating a false sense of security.

@dralley dralley Nov 20, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean the same applies with having a publish job separate from the build job in the first place (it also uses the download artifacts action). I don't think singling out the attestation task makes sense.

Also, how far does that logic go, because can we trust GHA in the first place? If we can't trust the upload/download actions, can we trust what is built there at all? Can we trust the attestations they provide? Trusted Publishing? etc.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically what I'm getting at is that the attestation and publish tasks both operate on the same artifacts downloaded by line 45. I don't think it's a concern necessarily, but if it is it's a pre-existing one.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's try that.

- name: "Publish package to PyPI"
uses: pypa/gh-action-pypi-publish@release/v1

Expand All @@ -59,6 +66,8 @@ jobs:
environment:
name: "pypi"
permissions:
attestations: "write"
contents: "read"
id-token: "write"

steps:
Expand All @@ -76,6 +85,11 @@ jobs:
tar -xvf {{ plugin.app_label }}-python-client.tar
{%- endfor %}

- name: "Attest Python client build provenance"
uses: "actions/attest@v4"
with:
subject-path: "{{ plugin_name }}/dist/*"

- name: "Publish client to pypi"
uses: "pypa/gh-action-pypi-publish@release/v1"
with:
Expand Down
Loading