Skip to content

Commit 4749fd5

Browse files
Copilotmrjf
andauthored
Fix evergreen agent instructions to create local tracking branch before push
The push_to_pull_request_branch tool requires a named local branch to create patches from. When the agent checks out the PR branch with a detached HEAD, the tool fails with "Branch does not exist locally". Updated step 2 of the agent instructions to explicitly use `git checkout -b` to create a local tracking branch. Agent-Logs-Url: https://github.com/githubnext/tsessebe/sessions/d2700d0e-7bbb-4650-aa27-84a4b45b7c29 Co-authored-by: mrjf <180956+mrjf@users.noreply.github.com>
1 parent 1fb0cbb commit 4749fd5

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

.github/workflows/evergreen.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,11 @@ A pre-flight step has already identified a PR that needs attention. Read the sel
279279
- `selected.base_branch` — the target branch (usually `main`)
280280
- `selected.attempts` — how many times we've already tried on this SHA
281281

282-
2. **Check out the PR branch** and investigate the issues.
282+
2. **Check out the PR branch** as a local tracking branch so the push tool can find it:
283+
```bash
284+
git checkout -b <head_branch> origin/<head_branch>
285+
```
286+
where `<head_branch>` is `selected.head_branch` from the selection file. **Do not** use a detached HEAD checkout — the `push-to-pull-request-branch` tool requires a named local branch.
283287

284288
3. **Fix the issues**:
285289

0 commit comments

Comments
 (0)