Skip to content

github_push: Add fork support and default PR body to commit message#17

Merged
cgwalters merged 2 commits into
mainfrom
agent-github-push-fork-support
Feb 27, 2026
Merged

github_push: Add fork support and default PR body to commit message#17
cgwalters merged 2 commits into
mainfrom
agent-github-push-fork-support

Conversation

@cgwalters

Copy link
Copy Markdown
Collaborator

No description provided.

When no body is provided for a draft PR, extract the commit message
body from the pushed commit and use it as the PR description. This
matches the GitHub web UI behavior for single-commit PRs, where the
PR body is auto-filled from the commit message.

Previously the body defaulted to an empty string, leaving the PR
description blank unless the caller explicitly provided one.

Assisted-by: OpenCode (claude-opus-4-6)
@cgwalters cgwalters marked this pull request as ready for review February 27, 2026 22:21
@cgwalters cgwalters enabled auto-merge February 27, 2026 22:22
@cgwalters cgwalters disabled auto-merge February 27, 2026 22:22
Add use_fork flag to github_push (default false). When set, the tool
discovers the authenticated user's fork via a GraphQL query (using the
forks(affiliations: [OWNER]) pattern from devaipod) and pushes to
the fork instead of the upstream. The draft PR is still created on the
upstream repo using the cross-repo head format (fork-owner:branch).

The fork discovery handles renamed forks correctly since it queries by
affiliation rather than assuming the fork name matches the upstream.
Permission checks are split: PushNewBranch is checked on the discovered
fork, CreateDraft on the upstream.

Also fix gh_update_pr_head to read head.repo.full_name from the PR data
and use that as the target for the ref update. Previously it always
targeted the base repo, which breaks for fork-based PRs where the head
branch lives in the fork.

Assisted-by: OpenCode (claude-opus-4-6)
@cgwalters cgwalters force-pushed the agent-github-push-fork-support branch from 1fcc2b5 to 5c99b8f Compare February 27, 2026 22:38
@cgwalters cgwalters enabled auto-merge February 27, 2026 22:39
@cgwalters cgwalters merged commit f0f45b6 into main Feb 27, 2026
1 check passed
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.

1 participant