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
After PR #40080 fixed the git "dubious ownership" error for cross-repo subdirectory checkouts, apply_samples.cjs now fails with a different error when a sidecars.patch sample targets
a side-repo checked out into a subdirectory (path: github):
[safeoutputs] Failed to pin branch 'gh-aw-sample-copilot-siderepo-subdir-pr': ERR_SYSTEM: fatal: Needed a single revision
The branch exists nowhere in the subdirectory checkout because apply_samples.cjs's
pre-stage-patch step (which creates the branch and applies the patch) runs in the main
workspace (GITHUB_WORKSPACE) rather than in the subdirectory checkout
(GITHUB_WORKSPACE/github). The MCP handler correctly resolves the repo checkout to /home/runner/work/gh-aw-test/gh-aw-test/github, then tries to pin the branch there,
but finds nothing.
[safeoutputs] Found repo checkout at: /home/runner/work/gh-aw-test/gh-aw-test/github
[safeoutputs] Using checkout-manifest default_branch for githubnext/gh-aw-side-repo: main
[debug] Executing git command: git rev-parse --verify refs/heads/gh-aw-sample-copilot-siderepo-subdir-pr^{commit}
[error] Git command failed: git rev-parse --verify refs/heads/gh-aw-sample-copilot-siderepo-subdir-pr^{commit}
[error] Exit status: 128
[error] Stderr: fatal: Needed a single revision
[safeoutputs] Failed to pin branch 'gh-aw-sample-copilot-siderepo-subdir-pr': ERR_SYSTEM: fatal: Needed a single revision
Note: there are no debug git-command logs before the MCP tool call — the branch-creation
(preStagePatch) step either ran in the wrong repo or was skipped entirely.
GH_AW_CHECKOUT_PATH_0 is set to "github" in the lockfile env.
Root cause hypothesis
apply_samples.cjs resolves the preStagePatch working directory using GITHUB_WORKSPACE
directly (the main repo root) instead of ${GITHUB_WORKSPACE}/${GH_AW_CHECKOUT_PATH_0}
(or the checkout manifest's path field for the target repo). The branch is therefore
created in the main repo checkout, not in the side-repo subdirectory, so the MCP server
cannot find it at ...github/.
Steps to reproduce
Configure a workflow with a path-namespaced cross-repo checkout (e.g. path: github)
Add a create-pull-request sample with a sidecars.patch / patch: field
Compile with --use-samples and trigger the workflow
Summary
After PR #40080 fixed the git "dubious ownership" error for cross-repo subdirectory checkouts,
apply_samples.cjsnow fails with a different error when asidecars.patchsample targetsa side-repo checked out into a subdirectory (
path: github):The branch exists nowhere in the subdirectory checkout because
apply_samples.cjs'spre-stage-patch step (which creates the branch and applies the patch) runs in the main
workspace (
GITHUB_WORKSPACE) rather than in the subdirectory checkout(
GITHUB_WORKSPACE/github). The MCP handler correctly resolves the repo checkout to/home/runner/work/gh-aw-test/gh-aw-test/github, then tries to pin the branch there,but finds nothing.
Failing test and run
test-copilot-siderepo-subdir-create-pull-request(githubnext/gh-aw-test)github/gh-aw/actions/setup@a053bc938134f2cb5bff4c6cd7e8c6e5f8db83a9(post-fix(safe-outputs): trust cross-repo checkout dirs from manifest (dubious ownership) #40080)Relevant log excerpt
Note: there are no debug git-command logs before the MCP tool call — the branch-creation
(preStagePatch) step either ran in the wrong repo or was skipped entirely.
Workflow config
GH_AW_CHECKOUT_PATH_0is set to"github"in the lockfile env.Root cause hypothesis
apply_samples.cjsresolves the preStagePatch working directory usingGITHUB_WORKSPACEdirectly (the main repo root) instead of
${GITHUB_WORKSPACE}/${GH_AW_CHECKOUT_PATH_0}(or the checkout manifest's
pathfield for the target repo). The branch is thereforecreated in the main repo checkout, not in the side-repo subdirectory, so the MCP server
cannot find it at
...github/.Steps to reproduce
path-namespaced cross-repo checkout (e.g.path: github)create-pull-requestsample with asidecars.patch/patch:field--use-samplesand trigger the workflowthan the old "dubious ownership" message — the fix(safe-outputs): trust cross-repo checkout dirs from manifest (dubious ownership) #40080 fix unmasked this second bug)
Related issues