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

Add build provenance attestation to the release workflow #128

Merged
merged 1 commit into from
Nov 25, 2024

Conversation

TimWolla
Copy link
Member

This PR builds upon #127 and includes that one as a subset. I will rebase it after #127 is merged.


This attestation proves that a given pie.phar was created by the release.yml workflow running for a specific commit.

Verification is possible using the gh CLI as follows:

gh attestation verify --owner php pie.phar

For the test in my fork, the output looked like this:

$ gh attestation verify --owner TimWolla pie.phar
Loaded digest sha256:0dc7f9c88341fc1beac5746658e4a859a1abe8b3f6a62aa9f10c9ec39ff42b53 for file://pie.phar
Loaded 2 attestations from GitHub API
✓ Verification succeeded!

sha256:0dc7f9c88341fc1beac5746658e4a859a1abe8b3f6a62aa9f10c9ec39ff42b53 was attested by:
REPO              PREDICATE_TYPE                  WORKFLOW
TimWolla/php-pie  https://slsa.dev/provenance/v1  .github/workflows/release.yml@refs/tags/release-action-build-provenance-1
TimWolla/php-pie  https://slsa.dev/provenance/v1  .github/workflows/release.yml@refs/heads/release-action-build-provenance

@asgrim asgrim self-assigned this Nov 25, 2024
@asgrim asgrim added the enhancement New feature or request label Nov 25, 2024
This attestation proves that a given pie.phar was created by the release.yml
workflow running for a specific commit.

Verification is possible using the `gh` CLI as follows:

    gh attestation verify --owner php pie.phar

For the test in my fork, the output looked like this:

    $ gh attestation verify --owner TimWolla pie.phar
    Loaded digest sha256:0dc7f9c88341fc1beac5746658e4a859a1abe8b3f6a62aa9f10c9ec39ff42b53 for file://pie.phar
    Loaded 2 attestations from GitHub API
    ✓ Verification succeeded!

    sha256:0dc7f9c88341fc1beac5746658e4a859a1abe8b3f6a62aa9f10c9ec39ff42b53 was attested by:
    REPO              PREDICATE_TYPE                  WORKFLOW
    TimWolla/php-pie  https://slsa.dev/provenance/v1  .github/workflows/release.yml@refs/tags/release-action-build-provenance-1
    TimWolla/php-pie  https://slsa.dev/provenance/v1  .github/workflows/release.yml@refs/heads/release-action-build-provenance
@TimWolla TimWolla force-pushed the release-action-build-provenance branch from abac1b8 to ec456ff Compare November 25, 2024 09:16
@TimWolla
Copy link
Member Author

Rebased now.

@TimWolla
Copy link
Member Author

Test failure is unrelated. Might be necessary to implicitly pass $GITHUB_TOKEN to PIE for API authentication?

@TimWolla TimWolla marked this pull request as ready for review November 25, 2024 09:31
Copy link
Collaborator

@asgrim asgrim left a comment

Choose a reason for hiding this comment

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

Thanks @TimWolla !

@asgrim asgrim added this to the 0.3.0 milestone Nov 25, 2024
@asgrim asgrim merged commit 33f911a into php:main Nov 25, 2024
20 checks passed
@TimWolla TimWolla deleted the release-action-build-provenance branch November 25, 2024 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants