fix(ci): skip the contract PR comment on fork PRs - #39
Merged
Merged
Conversation
A pull_request from a fork runs with a read-only GITHUB_TOKEN, so gh pr comment failed with 'Resource not accessible by integration' and turned the e2e job red. Same guard in the run composite action. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TWD Contract Validation
23 passed · 41 failed · 3 warnings · 1 skipped Failed validations./contracts/users-3.0.json
./contracts/posts-3.1.json
./contracts/products-3.0.json
./contracts/events-3.1.json
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
A
pull_requestfrom a fork runs with a read-onlyGITHUB_TOKEN, so the "Post contract report to PR" step fails withResource not accessible by integration (addComment)and turns thee2ejob red even when every test passed. Seen on #37.What changes
e2e.yml: the comment step runs only when the PR head is in this repository (github.event.pull_request.head.repo.full_name == github.repository)..github/actions/run/action.yml: same guard on its comment step, so a consumer's fork PRs stop failing there too.Fork PRs still run every test; they just do not get the comment. No
pull_request_target, which would give fork code a write token.