Repository navigation
fix(cli): match real gh pr create invocations and use the hook payload cwd - #1060
Conversation
🦋 Changeset detectedLatest commit: 7b77e39 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one) (2)
🚫 Excluded labels (none allowed) (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
uploads-auth | 7b77e39 | Oct 03 2026, 10:31 PM |
Summary
Two fixes to
uploads hook pre-pr-screenshot:looksLikeGhPrCreateusedcommand.includes("gh pr create"), so the reminder fired on commands that only mention the text, such asgrep "gh pr create" f.process.cwd(). In Claude desktop worktree sessions that is the main checkout, not the session's worktree.How it reproduced
The reminder fired on a
grepfor the phrase, and it reported the main checkout's branch (codex/openai-directory) from a desktop worktree session.Matching rule
grep "gh pr create" fandecho 'gh pr create'do not match.gh pr createmust be in command position: at the start, or after;,&,|,(or a newline, with optionalVAR=valueprefixes.gh pr create-ishdoes not match.cwd(or Cursorworkspace_roots[0]), thendeps.cwd, thenprocess.cwd(). A leadingcd <dir> &&overrides it when the directory exists.This is a pragmatic check, not a shell parser.
Tests
pnpm --filter @buildinternet/uploads test: 84 files, 1534 tests pass (new cases cover matching, non-matching, cwd precedence and leadingcd, using real temp git repos).pnpm --filter @buildinternet/uploads typecheckand rootpnpm typecheck: pass.pnpm lintfails in a fresh worktree on missing generatedworker-configuration.d.tsin apps/api, auth and mcp, which this change does not touch.Includes a patch changeset for
@buildinternet/uploads.Follow-up
plugins/claude/uploads/hooks/register.tsxhas a similarly loosePR_CREATE = /\bgh\s+pr\s+create\b/regex. It should get the same command-position treatment in a separate change.