Skip to content

default-workflow extracts wrong issue number from gh issue create output #3022

@rysweet

Description

@rysweet

Summary

default-workflow step step-03b-extract-issue-number currently extracts the issue number with:

echo "{{issue_creation}}" | grep -oE '[0-9]+' | tail -1

In practice this can capture an unrelated trailing digit from gh issue create output or other text and feed the wrong issue_number into branch naming.

Reproduction

During remediation of PR #3021, I launched default-workflow directly for a workflow-compliance fix. The recipe produced branch name:

feat/issue-3-recipevartaskdescription

That 3 did not correspond to the current work item. It caused the recipe to target an incorrect/stale branch namespace.

Expected

  • Parse the created issue number deterministically from the GitHub CLI response.
  • Fail loudly if the issue number cannot be extracted.

Actual

  • The workflow derived issue_number=3 and then built a bad branch name.

Suggested Fix

  • Use gh issue create --json number if available, or parse the created URL with a precise regex like /issues/<n>.
  • Add validation so non-matching output aborts before Step 4.

Impact

  • Wrong branch names
  • Collisions with unrelated stale branches
  • Follow-on failures in step-04-setup-worktree

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions