Skip to content

Commit 439b35f

Browse files
ci(test): skip test-trigger-other-job on fork PRs
The test-trigger-other-job job runs `gh workflow run`, which requires `actions: write` on the GITHUB_TOKEN. PRs from forks receive a read-only token by default, so this job has been failing on every fork-originated PR with: could not create workflow dispatch event: HTTP 403: Resource not accessible by integration Examples include #15 (dependabot) and any contributor PR. Skip this job when the PR head is in a different repository than the base. The job continues to run on PRs from same-repo branches and on direct pushes, where the token has the required permissions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 7247d00 commit 439b35f

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

.github/workflows/test.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ jobs:
8181
assert.ok(changelogContent.includes('### Fix'), 'Expected changelog to contain a header for fixes');
8282
test-trigger-other-job:
8383
runs-on: ubuntu-latest
84+
# Fork PRs receive a read-only GITHUB_TOKEN, so `gh workflow run`
85+
# below would fail with HTTP 403 ("Resource not accessible by
86+
# integration"). Skip this job for PRs from forks.
87+
if: github.event.pull_request.head.repo.full_name == github.repository
8488
steps:
8589
- uses: actions/checkout@v6
8690
with:

0 commit comments

Comments
 (0)