Fix GITHUB_TOKEN usage in external PR approval flow
Merged
PI
8mo ago+527+527+012345678901234567890123456789-799-799-012345678901234567890123456789
why
bug in previous approach
what changed
test plan
Summary by cubic
Fixes the external PR approval flow by switching to the correct GITHUB_TOKEN, stabilizing the mirror/refresh behavior, and ignoring third‑party bot comments when parsing claim markers. Also improves the claude workflow to build the repo before edits and allow rerunning failed jobs.
-
Bug Fixes
- Use
GITHUB_TOKENfor branch pushes and API calls; remove the GitHub App token path. - Enable
persist-credentials: trueduring checkout to allow pushes. - Keep the mirrored PR open and mark it stale when new commits land on the external PR; relabel both PRs consistently.
- Auto-handle reopen/close transitions across external and mirrored PRs.
- Ignore comments from non-managed bots (e.g., Greptile, Cubic); only parse claim markers from
github-actions[bot]to avoid false triggers.
- Use
-
Refactors
- Inline a small JS lib (
ECPR_LIB) to manage labels, comments, lifecycle, and claims; jobs run in clear phases (external lifecycle → claim prep → branch refresh → claim finalize). - Refresh internal branches by rebasing onto the approved external ref; report conflicts cleanly for manual follow-up.
- Improve
claude.yml: upgrade toactions/checkout@v6, setactions: write, runpnpm/turbobuild viasetup-node-pnpm-turbo, enabletrack_progress, and use an explicit tool allowlist foranthropics/claude-code-action@v1.
- Inline a small JS lib (