Skip to content

docs: add working-directory navigation example to side-repo-ops pattern#26123

Merged
pelikhan merged 2 commits intomainfrom
copilot/add-working-directory-navigation-example
Apr 14, 2026
Merged

docs: add working-directory navigation example to side-repo-ops pattern#26123
pelikhan merged 2 commits intomainfrom
copilot/add-working-directory-navigation-example

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 14, 2026

current: true is 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 explicit cd in 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 combining checkout.current: true + path: repo and the required cd prompt instruction:
checkout:
  - repository: ${{ github.event.inputs.target_repo }}
    path: repo
    github-token: ${{ secrets.GH_AW_MAIN_REPO_TOKEN }}
    current: true
Navigate into the folder where the target repository has been checked out into: cd ${{ github.workspace }}/repo
  • reference/checkout.md — adds an [!IMPORTANT] callout after the current: true code example clarifying the working-directory behaviour and showing the required cd pattern inline.

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>
Copilot AI changed the title [WIP] Add working-directory navigation example to side-repo-ops pattern docs: add working-directory navigation example to side-repo-ops pattern Apr 14, 2026
Copilot AI requested a review from pelikhan April 14, 2026 00:58
@pelikhan pelikhan marked this pull request as ready for review April 14, 2026 01:02
Copilot AI review requested due to automatic review settings April 14, 2026 01:02
@pelikhan pelikhan merged commit c5b4bf2 into main Apr 14, 2026
3 checks passed
@pelikhan pelikhan deleted the copilot/add-working-directory-navigation-example branch April 14, 2026 01:02
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 the current: true reference clarifying working-directory behavior and the need for an explicit cd.
  • Add an “Advanced Topics” example to the SideRepoOps pattern showing end-to-end checkout-to-path + current: true + cd prompt 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
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 …").

Suggested change
> 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

Copilot uses AI. Check for mistakes.

# Run Tests in Target Repository

Navigate into the folder where the target repository has been checked out into: cd ${{ github.workspace }}/repo
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 …".

Suggested change
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

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: add working-directory navigation example to side-repo-ops pattern

3 participants