Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

ci(docs-preview): skip publish/comment steps on fork PRs - #934

#934
Merged
igorpecovnik merged 1 commit into
armbian:mainarmbian/documentation:mainfrom
iav:ci/docs-preview-fork-guardiav/armbian-doc:ci/docs-preview-fork-guardCopy head branch name to clipboard
Jul 5, 2026
Merged

ci(docs-preview): skip publish/comment steps on fork PRs#934
igorpecovnik merged 1 commit into
armbian:mainarmbian/documentation:mainfrom
iav:ci/docs-preview-fork-guardiav/armbian-doc:ci/docs-preview-fork-guardCopy head branch name to clipboard

Conversation

@iav

@iav iav commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Problem

The docs-preview check is red on every PR opened from a fork, including PRs where the docs build fine. The job runs on the pull_request event, where a fork's GITHUB_TOKEN is read-only regardless of the workflow's declared permissions. The final step, Comment on PR with preview link (devindford/Append_PR_Comment), then fails:

##[error]HttpError: Resource not accessible by integration

The Publish to www branch step has the same problem but hides it behind || true; the comment step fails hard and turns the check red. The actual mkdocs build --clean step succeeds — only the write-back steps can't run.

Change

Guard the two steps that need a writable token with:

if: github.event.pull_request.head.repo.full_name == github.repository
  • Fork PRs: the MkDocs build still runs (validating the docs), the publish/comment steps are skipped, and the check goes green.
  • Internal branches (same-repo PRs): unchanged — preview is published and the comment posted as before.

pull_request_target would grant forks a writable token but checks out untrusted PR head with elevated permissions, so it is deliberately avoided.

Note: because pull_request runs the workflow from the base branch, this PR's own docs-preview run still uses the current (unpatched) workflow and stays red — the guard takes effect only after merge.

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>
@github-actions github-actions Bot added size/small PR with less then 50 lines Needs review Seeking for review GitHub Actions GitHub Actions code labels Jul 5, 2026
@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@iav, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 46 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 07dea7da-000e-4d63-9e6e-45c648098f73

📥 Commits

Reviewing files that changed from the base of the PR and between bea396d and 56fe520.

📒 Files selected for processing (1)
  • .github/workflows/pdf-at-pr.yaml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@igorpecovnik
igorpecovnik merged commit 36c70ba into armbian:main Jul 5, 2026
1 check passed
@iav
iav deleted the ci/docs-preview-fork-guard branch July 5, 2026 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

GitHub Actions GitHub Actions code Needs review Seeking for review size/small PR with less then 50 lines

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.