From 0fcab06b80d2d0f833aa74e97e886e3253514368 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=9F=E6=9C=88?= Date: Sat, 30 May 2026 15:41:08 +0800 Subject: [PATCH] =?UTF-8?q?improve(workflow):=20solve-issue=20=E2=80=94=20?= =?UTF-8?q?fix=20committer=20tea=20PR=20creation=20in=20worktrees?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove --repo flag from tea pr create (fails in git worktrees) - Add guard to skip staging when developer already committed changes Co-Authored-By: Claude Opus 4 --- .workflows/solve-issue.yaml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.workflows/solve-issue.yaml b/.workflows/solve-issue.yaml index 617c951..2bc614e 100644 --- a/.workflows/solve-issue.yaml +++ b/.workflows/solve-issue.yaml @@ -155,12 +155,14 @@ roles: cd into the worktree first. Note: You inherit the developer's worktree and branch. Do NOT create a new branch. - 1. Stage all changes: `git add -A` - 2. Commit with a descriptive message referencing the issue: `git commit -m "type: description\n\nFixes #N"` + 1. Check `git status` — if working tree is clean and branch is ahead of origin, skip to step 3 (push). + 2. If there are unstaged/uncommitted changes: `git add -A` then `git commit -m "type: description\n\nFixes #N"` 3. Push the branch: `git push -u origin ` - If push hook fails: capture the error log in your output, mark hook_failed - 4. On push success: create a PR via `tea pr create --repo --title "..." --description "..."` - - Extract owner/repo from: `git remote get-url origin | sed 's/.*[:/]\([^/]*\/[^.]*\).*/\1/'` + 4. On push success: create a PR. + - IMPORTANT: `tea pr create --repo` does NOT work inside git worktrees. You must cd to the main repo root first (the parent directory that contains `.worktrees/`). + - From the main repo root, run: `tea pr create --title "..." --description "..."` + - Do NOT use the `--repo` flag — let tea infer the repo from the git remote in CWD. - PR description must include: What / Why / Changes / Ref sections, with `Fixes #N` in Ref - On tea failure: capture stderr/stdout, include PR details for manual creation, mark hook_failed 5. After PR creation, clean up the worktree: