Uh oh!
There was an error while loading. Please reload this page.
Conversation
There was a problem hiding this comment.
Pull request overview
Updates base-branch resolution so cross-repo PR operations resolve the base branch against the configured target repository (not the workflow repo), and threads that base branch into patch generation.
Changes:
- Add an optional
targetRepoparameter togetBaseBranch()so issue_comment PR base lookups can query the correct repository. - Make
generateGitPatch()take an explicitbaseBranchargument and update callers/tests accordingly. - Resolve the configured target repo (via
repo_helpers) in safe-output handlers and other entrypoints before callinggetBaseBranch().
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| actions/setup/js/safe_outputs_handlers.test.cjs | Adds a mocked global.context needed by target-repo resolution in handler tests. |
| actions/setup/js/safe_outputs_handlers.cjs | Resolves target repo before calling getBaseBranch() and passes resolved base branch into generateGitPatch(). |
| actions/setup/js/push_to_pull_request_branch.cjs | Parses configured target repo and passes it into getBaseBranch() for cross-repo correctness. |
| actions/setup/js/git_patch_integration.test.cjs | Updates integration tests to pass an explicit base branch into generateGitPatch(). |
| actions/setup/js/get_base_branch.test.cjs | Adds coverage for the new optional targetRepo parameter. |
| actions/setup/js/get_base_branch.cjs | Implements targetRepo support for issue_comment PR base-branch API lookup. |
| actions/setup/js/generate_git_patch.test.cjs | Updates tests for the new generateGitPatch(branch, baseBranch, options) signature. |
| actions/setup/js/generate_git_patch.cjs | Changes patch generation to rely on a caller-provided base branch (no internal getBaseBranch() lookup). |
| actions/setup/js/create_pull_request.cjs | Parses configured target repo and passes it into getBaseBranch() for cross-repo correctness. |
| actions/setup/js/create_agent_session.cjs | Parses configured target repo and passes it into getBaseBranch() for cross-repo correctness. |
Comments suppressed due to low confidence (1)
actions/setup/js/safe_outputs_handlers.cjs:199
- resolveTargetRepoConfig() ultimately falls back to
context.repo(repo_helpers.getDefaultTargetRepo). In the MCP server entrypoint (safe-outputs-mcp-server.cjs), onlyglobal.coreis shimmed (shim.cjs) andglobal.contextis not set, so invokingcreate_pull_requestvia the MCP server can throw a ReferenceError when notarget-repo/GH_AW_TARGET_REPO_SLUG is configured. Consider adding a local fallback here (e.g., preferprConfig["target-repo"], thenprocess.env.GH_AW_TARGET_REPO_SLUG, thenprocess.env.GITHUB_REPOSITORY) and/or explicitly error with ERR_CONFIG when none are available instead of relying oncontext.
// Resolve target repo for base branch resolution (cross-repo scenarios)
const prConfig = config.create_pull_request || {};
const { defaultTargetRepo } = resolveTargetRepoConfig(prConfig);
const targetRepoParts = parseRepoSlug(defaultTargetRepo);
const baseBranch = await getBaseBranch(targetRepoParts);
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
For cross-repo PRs,
getBaseBranch()needed to become dependent on the target repoThis does structural work to get that to happen