docs: add working-directory navigation example to side-repo-ops pattern#26123
docs: add working-directory navigation example to side-repo-ops pattern#26123
Conversation
Adds a 'Checking Out the Target Repository' subsection under Advanced Topics in side-repo-ops.mdx, demonstrating how to combine checkout with current: true and an explicit path:, plus an explicit cd instruction in the prompt. Also adds an IMPORTANT callout to checkout.md clarifying that current: true annotates the agent prompt only and does not set the working directory automatically. Closes #<issue-number>" Agent-Logs-Url: https://github.com/github/gh-aw/sessions/98aa008e-1840-46fa-b806-234f5eca6882 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Clarifies that checkout.current: true does not change the agent’s working directory, and provides explicit cd guidance to prevent agents from running local tools in the wrong repo.
Changes:
- Add an
[!IMPORTANT]callout to thecurrent: truereference clarifying working-directory behavior and the need for an explicitcd. - Add an “Advanced Topics” example to the SideRepoOps pattern showing end-to-end checkout-to-path +
current: true+cdprompt instruction.
Show a summary per file
| File | Description |
|---|---|
| docs/src/content/docs/reference/checkout.md | Adds an IMPORTANT callout explaining that current: true doesn’t change the working directory and shows the required cd pattern. |
| docs/src/content/docs/patterns/side-repo-ops.mdx | Adds a concrete workflow example for checking out a target repo to a named path and explicitly cd-ing into it. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 2
| > `current: true` only annotates the agent's system prompt to identify the target repository — it does **not** automatically change the working directory. If the agent needs to run local tools (tests, linters, build scripts) against the checked-out repository, add an explicit `cd` instruction to the prompt: | ||
| > | ||
| > ``` | ||
| > Navigate into the folder where the target repository has been checked out into: cd ${{ github.workspace }}/target |
There was a problem hiding this comment.
The phrase "has been checked out into" is ungrammatical (double “into”) and may read awkwardly in the example prompt. Consider rephrasing to something like "checked out to" / "checked out at" / "checked out in" (e.g., "Navigate to the checked-out repository: cd …").
| > Navigate into the folder where the target repository has been checked out into: cd ${{ github.workspace }}/target | |
| > Navigate to the checked-out target repository: cd ${{ github.workspace }}/target |
|
|
||
| # Run Tests in Target Repository | ||
|
|
||
| Navigate into the folder where the target repository has been checked out into: cd ${{ github.workspace }}/repo |
There was a problem hiding this comment.
The sentence "has been checked out into" reads awkwardly (double “into”). Rephrase the instruction to something like "Navigate to the checked-out repository: cd …" or "Navigate into the checked-out repository directory: cd …".
| Navigate into the folder where the target repository has been checked out into: cd ${{ github.workspace }}/repo | |
| Navigate to the checked-out repository: cd ${{ github.workspace }}/repo |
current: trueis commonly misread as "make this the cwd" — it only injects a hint into the agent's system prompt and has no effect on the actual working directory. Without an explicitcdin the prompt, the agent starts in$GITHUB_WORKSPACE(the side repo root) and must infer the correct path.Changes
patterns/side-repo-ops.mdx— adds a new "Checking Out the Target Repository" subsection under Advanced Topics with a concrete end-to-end example combiningcheckout.current: true+path: repoand the requiredcdprompt instruction:reference/checkout.md— adds an[!IMPORTANT]callout after thecurrent: truecode example clarifying the working-directory behaviour and showing the requiredcdpattern inline.