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
{{ message }}
Repository navigation
Getting "template not found" errors for gh pr create --template=... #9220
Running through the gh pr create interactive steps picks up template in .github/pull_request_template.md, however if I supply a --template option in gh pr create --template=/path/to/template then I get template "/path/to/template" not found. I've tried both relative and absolute paths and can't get either of them to pick up the template file successfully.
gh version 2.49.2 (2024-05-13)
https://github.com/cli/cli/releases/tag/v2.49.2
Steps to reproduce the behavior
Have a template located at /path/to/template.md
Run gh pr create --template /path/to/template.md
See the error
Expected vs actual behavior
Expect to have the template injected into my editor for interactive editing. Actually just get an error
With @PhilippFeO being addressed in #9327 and this issue most likely being a result of misunderstood flag values, I've updated the examples for issue create and pr create to demonstrate that we only expect the filename, not the full file path in #9354 . Thanks!
Activity
williammartin commentedon Jun 24, 2024
Have you tried just providing the name of the file e.g
gh pr create --template template.mdDuring the PR creation flow we request the templates from the API with a query like so:
I think we then use the
--templatearg to match thefilenamehere. The templates can exist in different locations in the git repo. I'm not exactly sure what happens if they are not unique.PhilippFeO commentedon Jul 17, 2024
I have the same issue with
gh issue create --template FILEwilliammartin commentedon Jul 23, 2024
With @PhilippFeO being addressed in #9327 and this issue most likely being a result of misunderstood flag values, I've updated the examples for
issue createandpr createto demonstrate that we only expect the filename, not the full file path in #9354 . Thanks!