fix(v0.6.6): prs create --json and issues create --json always failed - #16
Merged
Conversation
gh pr create and gh issue create don't accept --json (only list/view do),
but both scripts appended --json number,url,title directly to the create
call. Every JSON-mode create exited "unknown flag: --json" before creating
anything.
The dangerous part: the natural recovery -- drop --json and retry the
identical command -- looks like a no-op fix but actually succeeds, silently
publishing a real PR/issue with whatever placeholder title/body was in the
retry. Hit this live: an agent invocation failed on --json, retried without
it to "just see the error again", and instead published a PR titled "test
title" on a real repo before anyone caught it.
Fixed the same way prs comment / issues comment already handle this in this
same file: create without --json, parse the number out of the URL gh prints
on stdout, then fetch the documented {number, url, title} shape from
gh pr view / gh issue view.
Refs #15
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M1Ts8qwUqfvZK8GtE21bhm
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.
Summary
Fixes #15.
gh pr createandgh issue createdon't accept--json(onlylist/viewdo), but bothprs createandissues createappended--json number,url,titledirectly to the create call — every JSON-mode create exitedunknown flag: --jsonbefore creating anything.The dangerous part: the natural recovery — drop
--jsonand retry the identical command — looks like a no-op but actually succeeds, silently publishing a real PR/issue with whatever placeholder title/body was in the retry. Hit this live: an agent invocation failed on--json, retried without it, and published a PR titled "test title" on a real repo before anyone caught it.Fix
Same pattern this file already uses for
prs comment/issues comment: create without--json, parse the number out of the URLghprints on stdout (tail -n1for safety), then fetch the documented{number, url, title}shape fromgh pr view/gh issue view.Test Plan
shellcheck --severity=warningon both changed scripts (matches CI)bash -nsyntax check on both--helpsmoke test on bothbin/fledge-github-prs create --json— if the fix were broken, this PR wouldn't exist with correct title/bodyplugin.tomlbumped to 0.6.6,CHANGELOG.mdupdated🤖 Generated with Claude Code