Skip to content

fix(ci): gh pr create doesn't support --json flag - #65221

Merged
ethernet8023 merged 1 commit into
mainfrom
ethie/fix-gh-pr-create
Jul 15, 2026
Merged

fix(ci): gh pr create doesn't support --json flag#65221
ethernet8023 merged 1 commit into
mainfrom
ethie/fix-gh-pr-create

Conversation

@ethernet8023

Copy link
Copy Markdown
Collaborator

What does this PR do?

The js-autofix workflow (merged in #65186) uses gh pr create --json number --jq '.number' to capture the PR number, but gh pr create doesn't support
the --json flag — every workflow run fails with unknown flag: --json.

Extract the PR number from the URL that gh pr create prints to stdout
instead (format: https://github.com/<org>/<repo>/pull/<number>).

Related Issue

Follow-up fix for the workflow merged in #65186.

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)

Changes Made

  • .github/workflows/js-autofix.yml: replaced gh pr create --json number --jq '.number' with PR_URL=$(gh pr create ...) + PR_NUM=$(echo "$PR_URL" | grep -oE '[0-9]+$')

How to Test

  1. Merge this PR.
  2. Trigger the auto-fix lint issues & formatting workflow (push a JS file with a fixable lint issue to main, or workflow_dispatch).
  3. The apply-patch job should successfully create a PR on bot/js-autofix instead of failing with unknown flag: --json.

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass — N/A: CI workflow change, no Python tests affected
  • I've added tests for my changes — N/A: GitHub Actions workflow, validated via YAML parse + structure check
  • I've tested on my platform: NixOS (workflow YAML validated with yaml.safe_load)

Documentation & Housekeeping

  • I've updated relevant documentation — N/A (workflow internal)
  • I've updated cli-config.yaml.example if I added/changed config keys — N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — N/A
  • I've considered cross-platform impact — N/A (GitHub Actions only)
  • I've updated tool descriptions/schemas if I changed tool behavior — N/A

Screenshots / Logs

Failing run after #65186 merged:

Apply patch	Create/update PR and enable auto-merge	unknown flag: --json
Apply patch	Create/update PR and enable auto-merge	Usage:  gh pr create [flags]
Apply patch	Create/update PR and enable auto-merge	##[error]Process completed with exit code 1.

The js-autofix workflow used 'gh pr create --json number --jq .number'
to capture the PR number, but 'gh pr create' doesn't support --json.
Extract the PR number from the URL that 'gh pr create' prints instead.
@ethernet8023 ethernet8023 added the ci-reviewed applied to manually approve dangerous changes label Jul 15, 2026
@ethernet8023
ethernet8023 enabled auto-merge (squash) July 15, 2026 21:23
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have sweeper:risk-automation Sweeper risk: may affect CI, automerge, label sync, or maintainer automation labels Jul 15, 2026
@ethernet8023
ethernet8023 merged commit 5222d24 into main Jul 15, 2026
37 checks passed
@ethernet8023
ethernet8023 deleted the ethie/fix-gh-pr-create branch July 15, 2026 21:27
Gravezzz pushed a commit to Gravezzz/hermes-agent that referenced this pull request Jul 21, 2026
The js-autofix workflow used 'gh pr create --json number --jq .number'
to capture the PR number, but 'gh pr create' doesn't support --json.
Extract the PR number from the URL that 'gh pr create' prints instead.
randlee pushed a commit to randlee/hermes-agent that referenced this pull request Aug 11, 2026
The js-autofix workflow used 'gh pr create --json number --jq .number'
to capture the PR number, but 'gh pr create' doesn't support --json.
Extract the PR number from the URL that 'gh pr create' prints instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-reviewed applied to manually approve dangerous changes P3 Low — cosmetic, nice to have sweeper:risk-automation Sweeper risk: may affect CI, automerge, label sync, or maintainer automation type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants