Skip to content

Commit

Permalink
Do not generate provenance on PR builds
Browse files Browse the repository at this point in the history
It does not make sense to do so; nor do PR submitters have permission to do so.
We can't write attestations to `php/pie` in an unprivileged context, otherwise
anyone could send a PR with malicious code, store attestation that `php/pie`
built the PHAR, and it would look genuine.
  • Loading branch information
asgrim committed Nov 27, 2024
1 parent 147696d commit 8263560
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/build-phar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,13 @@ jobs:
run: box compile
- name: Check the PHAR executes
run: php pie.phar --version
# It does not make sense to do this for PR builds, not do contributors
# have permission to do. We can't write attestations to `php/pie` in an
# unprivileged context, otherwise anyone could send a PR with malicious
# code, which would store attestation that `php/pie` built the PHAR, and
# it would look genuine. So this should NOT run for PR builds.
- name: Generate build provenance attestation
if: github.event_name != 'pull_request'
uses: actions/attest-build-provenance@v1
with:
subject-path: '${{ github.workspace }}/pie.phar'
Expand Down

0 comments on commit 8263560

Please sign in to comment.