Repository navigation
Closed
Labels
bugSomething isn't workinggh-prrelating to the gh pr commandpriority-1Affects a large population and inhibits work
Description
Describe the bug
gh pr create --web now always generates autofilled content; previously, the contents of .github/PULL_REQUEST_TEMPLATE.md would be populated. It looks like the behaviour now defaults to --fill, even though I don't provide that flag.
Affected version
This was introduced in #10547 (fixes #10527) and released in v2.75.0.
Steps to reproduce the behavior
- Make sure the repository has a non-empty
.github/PULL_REQUEST_TEMPLATE.md - On a topic branch, create and push a few commits
- Run
gh pr create --web
Expected vs actual behavior
Actual: the title is prefilled with the branch name, and the body is a list of commit titles.
The previous (and expected) behaviour was to leave the title empty (I think...) and have the body pre-populated with the contents of .github/PULL_REQUEST_TEMPLATE.md.
Logs
Click for logs
$ GH_DEBUG=api gh pr create --web
[git remote -v]
[git config --get-regexp ^remote\..*\.gh-resolved$]
* Request at 2025-07-11 10:12:13.294054503 -0700 PDT m=+0.036090788
* Request to https://api.github.com/graphql
> POST /graphql HTTP/1.1
> Host: api.github.com
> Accept: application/vnd.github.merge-info-preview+json, application/vnd.github.nebula-preview
> Authorization: token ████████████████████
> Content-Length: 392
> Content-Type: application/json; charset=utf-8
> Graphql-Features: merge_queue
> Time-Zone: America/Vancouver
> User-Agent: GitHub CLI 2.75.0
GraphQL query:
fragment repo on Repository {
id
name
owner { login }
viewerPermission
defaultBranchRef {
name
}
isPrivate
}
query RepositoryNetwork {
viewer { login }
repo_000: repository(owner: "myorg", name: "myrepo") {
...repo
parent {
...repo
}
}
}
GraphQL variables: null
< HTTP/2.0 200 OK
< Access-Control-Allow-Origin: *
< Access-Control-Expose-Headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset
< Content-Security-Policy: default-src 'none'
< Content-Type: application/json; charset=utf-8
< Date: Fri, 11 Jul 2025 17:12:15 GMT
< Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin
< Server: github.com
< Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
< Vary: Accept-Encoding, Accept, X-Requested-With
< X-Accepted-Oauth-Scopes: repo
< X-Content-Type-Options: nosniff
< X-Frame-Options: deny
< X-Github-Media-Type: github.v4; param=merge-info-preview.nebula-preview; format=json
< X-Github-Request-Id: CC7C:289371:4546EF1:8BFE0B0:687145EE
< X-Oauth-Client-Id: 178c6fc778ccc68e1d6a
< X-Oauth-Scopes: admin:enterprise, admin:org, admin:org_hook, admin:public_key, gist, project, repo
< X-Ratelimit-Limit: 5000
< X-Ratelimit-Remaining: 4998
< X-Ratelimit-Reset: 1752257518
< X-Ratelimit-Resource: graphql
< X-Ratelimit-Used: 2
< X-Xss-Protection: 0
{
"data": {
"viewer": {
"login": "bewuethr"
},
"repo_000": {
"id": "someID=",
"name": "myrepo",
"owner": {
"login": "myorg"
},
"viewerPermission": "ADMIN",
"defaultBranchRef": {
"name": "main"
},
"isPrivate": true,
"parent": null
}
}
}
* Request took 522.365894ms
[git status --porcelain]
[git symbolic-ref --quiet HEAD]
[git config --get-regexp ^branch\.topic-branch\.(remote|merge|pushremote|gh-merge-base)$]
[git rev-parse --symbolic-full-name fix-annotation@{push}]
[git show-ref --verify -- HEAD refs/remotes/origin/topic-branch]
[git -c log.ShowSignature=false log --pretty=format:%H%x00%s%x00%b%x00 --cherry origin/main...topic-branch]
Opening https://github.com/myorg/myrepo/compare/main...topic-branch in your browser.
Opening in existing browser session.Reacted by Austin Orth
Reacted by Andy Feller
Metadata
Metadata
Assignees
Labels
bugSomething isn't workinggh-prrelating to the gh pr commandpriority-1Affects a large population and inhibits work
Activity
andyfeller commentedon Jul 11, 2025
Thank you for raising this concern up and my apologies for the problem, @bewuethr! 🙇 Let me dig into this a little deeper to assess the original PR and the information provided.
Expand for my regression testing notes
Base line
Testing
v2.74.2against single-commit branchcli/cli#10547gh pr create --weblaunches pull request where the UI defaults the title and body based on the commit combined with default pull request templategh pr create --web --title "Title from a flag"launches pull request withtitleparameter where the UI uses the title from the flag and the body based on the commit combined with default pull request templategh pr create --web --body "Body from a flag"launches pull request withbodyparameter where the UI defaults the title based on the commit and the body from the flag, no template usedgh pr create --web --template nonstandard.mdlaunches pull request withtemplateparameter where the UI uses the title from the flag and the body based on the commit combined with non-standard pull request templateTesting
v2.74.2against multi-commit branchcli/cli#10547-multigh pr create --weblaunches pull request where the UI defaults the title to " + multi" and body based on the default pull request templategh pr create --web --title "Title from a flag"launches pull request withtitleparameter where the UI uses the title from the flag and the body based on the default pull request templategh pr create --web --body "Body from a flag"launches pull request withbodyparameter where the UI defaults the title to " + multi" and body from the flaggh pr create --web --template nonstandard.mdlaunches pull request withtemplateparameter where the UI defaults the title to " + multi" and body based on the non-standard pull request templateTesting
v2.75.0against single-commit branchcli/cli#10547gh pr create --weblaunches pull request withtitleandbodyparametersaustinorth commentedon Jul 14, 2025
I am also running into this behavior. Slowing my workflow down considerably, so kudos to whomever is able to resolve. Here are versions:
andyfeller commentedon Jul 14, 2025
@bewuethr @austinorth: I've been putting together regression notes (see above) and discussing this with maintainers and figuring out a path forward.
andyfeller commentedon Jul 14, 2025
Follow up
TLDR
gh pr createprioritize--titleand--bodyover--fillwhen--webis present #10547 changes have highlighted a non-obvious side effect for affectinggh pr create --webexperiencesgh pr createprioritize--titleand--bodyover--fillwhen--webis present #10547 is going to be reverted andv2.75.1hotfix released to unblock usersgh pr create --webdoes not respecttitleandbodyarguments #10527 will be reopened with this new context to determine an appropriate fix as well as additional tests to ensure this works as expectedcc: @simon-isler
Regression explained
I believe this regression is due to unexpected side effect in the previous
gh pr create --webcode related to the logic of generating title and body from local commits.Under the covers,
gh pr createcallsinitDefaultTitleBody(...)to determine a default title and body based on local git commits, which are stored in the issue metadata state type:cli/pkg/cmd/pr/create/create.go
Lines 386 to 418 in 798d903
cli/pkg/cmd/pr/create/create.go
Lines 625 to 655 in 798d903
cli/pkg/cmd/pr/create/create.go
Lines 595 to 623 in 798d903
Prior to
v2.75.0, the following logic blanked this information out when launch the browser for--webflag:cli/pkg/cmd/pr/create/create.go
Lines 393 to 405 in 2b89358
This had the side effect of allowing the GitHub.com PR creation experience to determine the title and body using server-side information. I believe this wasn't caught by
gh pr createtests because of the local git commit state needed to be setup when going to web.andyfeller commentedon Jul 14, 2025
This should be fixed in
v2.75.1, thank you again for your patience! 🙇bewuethr commentedon Jul 14, 2025
Excellent, thank you for the prompt fix!