Fix label-check and auto-assign on fork PRs#83
Conversation
Fork-submitted PRs get a read-only token on pull_request runs, so the label and assignee bots fail with 403. pull_request_target runs in the base repo context with a write token; safe here because neither job checks out or executes PR code. Build jobs stay on pull_request. Trim ci.yml permissions to what the builds need.
|
Warning Review limit reached
More reviews will be available in 6 minutes and 40 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ 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 |
Version: N/A (workflows only, does not publish)
What does this implement/fix?
Fixes the Label Check and Auto Assign failures on fork-submitted PRs (seen on the CO2 auto calibration PR).
Workflows triggered by
pull_requestfrom a fork run with a read-only token, soactions-ecosystem/action-add-labelsandpozil/auto-assign-issuefail with403 Resource not accessible by integration. Moving those two jobs topull_request_targetruns them in the base repo's context with a write token.ci.ymlinto its ownlabel-check.ymlonpull_request_target(witheditedin the trigger types, so fixing a checkbox re-runs the check). The firmware build jobs stay onpull_request, since they compile PR-controlled YAML and must never get a write token.autoassign.ymlswitches its PR trigger topull_request_target(issues trigger unchanged).ci.ymlpermissions are trimmed to what the build jobs need.This is safe because neither moved job checks out or executes PR code. Depends on ApolloAutomation/Workflows#24, which hardens the reusable label-check against script injection from the PR body; that PR should merge first.
Same fix is rolling out to every device repo with these workflows: AIR-1, MSR-2, MTR-1, R_PRO-1, PLT-1, TEMP-1, BTN-1, H-1, H-2, MSR-1, and PUMP-1.
Types of changes
Checklist / Checklijst:
If user-visible functionality or configuration variables are added/modified:
🤖 Generated with Claude Code