github_push: Add fork support and default PR body to commit message#17
Merged
Conversation
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)
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)
1fcc2b5 to
5c99b8f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.