Skip to content

Commit 3402322

Browse files
Disable build attestations for PRs from forks
Conditionally enable build provenance attestations only when not running in a fork PR context. Fork PRs lack the necessary permissions (id-token and attestations write) to create attestations, causing workflow failures. Attestations now only run for: - Pushes to branches - PRs from branches within the same repository 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 6522881 commit 3402322

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
id: baipp
2222
uses: hynek/build-and-inspect-python-package@v2
2323
with:
24-
attest-build-provenance-github: true
24+
attest-build-provenance-github: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
2525
env:
2626
SETUPTOOLS_SCM_OVERRIDES_FOR_INICONFIG: ${{ github.ref == 'refs/heads/main' && 'local_scheme="no-local-version"' || '' }}
2727

0 commit comments

Comments
 (0)