Skip to content

fix(ci): cora review works on fork PRs + v0.4.2 - #179

Merged
ajianaz merged 1 commit into
developfrom
fix/cora-review-fork-pr
Jun 6, 2026
Merged

ajianaz merged 1 commit into
developfrom
fix/cora-review-fork-pr

Conversation

@ajianaz

@ajianaz ajianaz commented Jun 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Changed cora-review.yml trigger from pull_request to pull_request_target — gives GITHUB_TOKEN write access for PR comments on external/fork contributor PRs
  • Explicit checkout of PR head SHA — ensures correct diff even with pull_request_target context
  • Version bump 0.4.1 → 0.4.2

Why

External contributor PRs (forks) failed Cora Review with 403 "Resource not accessible by integration" because pull_request trigger runs in fork context with read-only token. The pull_request_target trigger runs in the base repo context with write permissions, solving this.

Security Note

pull_request_target is safe here because:

  • Uses composite action from base repo (.github/actions/cora-review) — not fork code
  • Only reads diffs and posts comments — no arbitrary code execution from forks
  • secrets are accessible (needed for CORA_API_KEY) but not exposed to fork code

Included in v0.4.2

Test Plan

  • cargo build --release ✅
  • cargo test (16 + 6 tests) ✅
  • cargo fmt --check ✅
  • Verify Cora Review posts comment on this PR (validates the fix works for same-repo PRs)
  • External contributor PR needed to fully validate fork scenario

- Change trigger from pull_request to pull_request_target for write access
- Explicit checkout of PR head SHA for correct diff
- Bump version 0.4.1 → 0.4.2
- Includes provider shortcuts from PR #178
@ajianaz
ajianaz merged commit 1c23300 into develop Jun 6, 2026
10 checks passed
@ajianaz
ajianaz deleted the fix/cora-review-fork-pr branch June 6, 2026 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant