Commit 68f7bac
feat(pr): add --attach for GitHub pull requests (#43)
* feat(pr): add --attach for GitHub pull requests
GitHub CLI 2.99.0 can upload images and videos on `gh pr create --attach`.
`pq pr` and `pq submit` now accept the same flag when they create a new PR.
Parse `path[#alt]` into `PRAttachment` at the CLI. Validate that each path is
a file, reject duplicates, and cap the list at 50. Forward the values through
`GitHubPort.create_pr`.
`verify-panqake` writes a 1x1 PNG for attach recipes and pins GitHub CLI
2.99.0 or newer onto the fixture PATH.
Co-authored-by: SarthakJariwala <SarthakJariwala@users.noreply.github.com>
* chore(pr): drop restating helper docstrings
The helpers already name parse, validate, and pull-request URL extraction.
Co-authored-by: SarthakJariwala <SarthakJariwala@users.noreply.github.com>
* fix(pr): stop treating failed gh create as success
A nonzero `gh pr create` is success only when gh printed a pull request
URL. That matches the partial `--attach` upload contract. An existing PR
for the head is not treated as success.
PRCreationError now includes gh stderr. The 2.99.0 hint fires only when
stderr reports an unknown `--attach` flag. Relative `--attach ./file`
spellings are kept so gh can rewrite matching body paths.
Co-authored-by: SarthakJariwala <SarthakJariwala@users.noreply.github.com>
* fix(pr): seed PR body from --attach when description is empty
--defaults (and other empty descriptions) previously passed --body "" to
gh pr create. GitHub CLI then left attachments unreferenced in the body,
so the image did not show on the PR. Fill that empty body with 
so gh can rewrite the upload URL in place.
Co-authored-by: SarthakJariwala <SarthakJariwala@users.noreply.github.com>
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: SarthakJariwala <SarthakJariwala@users.noreply.github.com>1 parent 6c9b640 commit 68f7bac
0 file changed
0 commit comments