Skip to main content

What We Learned

gh issue create --project "Block C" fails silently on issue creation then errors on project assignment when the actual title is "Block C: API Gateway Setup". The GitHub CLI does not do substring or fuzzy matching on org-level project titles. Similarly, --label "security" fails in repos where that label doesn’t exist, and label inventories vary across repos in the same org.

Why It Matters

Batch issue creation scripts are write-once-run-once — failures mid-batch leave partial state (some issues created, some not, project assignments missing). The fix requires querying exact project titles and per-repo label inventories before generating any scripts.

The Pattern

Always preflight before generating gh issue create scripts:
# Get exact project titles
gh project list --owner choco-hq --format json | jq '.[].title'

# Get labels per target repo
gh label list --repo choco-hq/choco-auth --json name --jq '.[].name' | sort
Embed the results directly into the script — never assume label or project names.

Applicability

Any automation that files issues across multiple repos in a GitHub org. Particularly relevant when block:* labels were created in some repos but not others during a triage session.