You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 2a45faf
Browse filesBrowse the repository at this point in the historyBrowse files
Use agent_assignment API to guarantee base branch on Copilot assignment
Replace the body-prepend workaround with the REST API's
agent_assignment.base_branch field when assigning issues to Copilot.
This is the programmatic equivalent of selecting the branch in the
GitHub UI and guarantees Copilot creates its topic branch from
BASE_BRANCH instead of defaulting to main.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy file name to clipboardExpand all lines: .github/skills/shepherd-task-from-assignment-to-ready/SKILL.md
+28-52Lines changed: 28 additions & 52 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,73 +25,49 @@ Automate the lifecycle of a child **Task** issue from "assigned to Copilot" thro
25
25
26
26
## Procedure
27
27
28
-
### Step 1: Assign the task to @Copilot
28
+
### Step 1: Assign the task to @Copilot with `base_branch`
29
29
30
-
First, prepend an instruction to the issue body telling Copilot which base branch to use. This must happen **before** assignment to avoid a race condition where Copilot targets `main` instead.
31
-
32
-
**Idempotency:** If the issue body already starts with `**Base branch:**`, skip the prepend (it was already done in a prior run).
30
+
Use the REST API's `agent_assignment` object to assign the issue to Copilot **and** specify the base branch in a single atomic call. This guarantees Copilot branches from `$BASE_BRANCH` (equivalent to selecting the branch in the GitHub UI).
33
31
34
32
```bash
35
-
# Check if already prepended (idempotency guard)
36
-
CURRENT_BODY=$(gh issue view $TASK_ISSUE -R $REPO --json body --jq '.body')
37
-
ifecho"$CURRENT_BODY"| head -1 | grep -q '^\*\*Base branch:\*\*';then
**Base branch:** Create your PR targeting \`$BASE_BRANCH\` (not \`main\`).
44
-
45
-
**Requirement:** When you open the PR, the very first thing you put in the description must be \`Fixes #$TASK_ISSUE\` where the issue number is this issue for which the PR aims to implement the work.
> **Base branch:** Create your PR targeting ``$BASE_BRANCH`` (not ``main``).
64
-
>
65
-
> **Requirement:** When you open the PR, the very first thing you put in the description must be ``Fixes #$TASK_ISSUE`` where the issue number is this issue for which the PR aims to implement the work.
Use **all three** of the following strategies (in order) each polling iteration. Copilot often creates PRs whose title or branch name does NOT contain the issue number — it may use a descriptive name instead. Therefore, relying on title/branch regex alone is insufficient.
0 commit comments