ci(docs-preview): skip publish/comment steps on fork PRs - #934
#934ci(docs-preview): skip publish/comment steps on fork PRs#934igorpecovnik merged 1 commit intoarmbian:mainarmbian/documentation:mainfrom iav:ci/docs-preview-fork-guardiav/armbian-doc:ci/docs-preview-fork-guardCopy head branch name to clipboard
Conversation
The docs-preview workflow runs on `pull_request`, where a fork's GITHUB_TOKEN is read-only. The "Comment on PR with preview link" step then fails with "Resource not accessible by integration", turning the check red on every external contributor's PR even though the MkDocs build succeeded. Guard the two write-requiring steps (www publish, PR comment) with `if: github.event.pull_request.head.repo.full_name == github.repository`. Fork PRs still run the build that validates the docs but skip the steps needing write access, so the check stays green; internal branches publish the preview as before. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 46 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Problem
The
docs-previewcheck is red on every PR opened from a fork, including PRs where the docs build fine. The job runs on thepull_requestevent, where a fork'sGITHUB_TOKENis read-only regardless of the workflow's declaredpermissions. The final step, Comment on PR with preview link (devindford/Append_PR_Comment), then fails:The
Publish to www branchstep has the same problem but hides it behind|| true; the comment step fails hard and turns the check red. The actualmkdocs build --cleanstep succeeds — only the write-back steps can't run.Change
Guard the two steps that need a writable token with:
pull_request_targetwould grant forks a writable token but checks out untrusted PR head with elevated permissions, so it is deliberately avoided.Note: because
pull_requestruns the workflow from the base branch, this PR's owndocs-previewrun still uses the current (unpatched) workflow and stays red — the guard takes effect only after merge.