Skip to content

Improve gh.sh wrapper: stricter validation and better error messages#30066

Merged
OctavianGuzu merged 1 commit intomainfrom
oct/gh-wrapper-improvements
Mar 2, 2026
Merged

Improve gh.sh wrapper: stricter validation and better error messages#30066
OctavianGuzu merged 1 commit intomainfrom
oct/gh-wrapper-improvements

Conversation

@OctavianGuzu
Copy link
Collaborator

Summary

Tighten up the gh.sh wrapper script used by issue-triage and dedupe workflows.

Changes

  • Allowlist for issue view: require exactly one numeric issue number (no URLs or other formats)
  • Zero-positional enforcement for issue list / label list — these commands don't accept positionals anyway
  • Explicit env pinning: GH_HOST=github.com and GH_REPO set from GITHUB_REPOSITORY with format validation, so gh doesn't fall back to git-remote inference
  • Descriptive error messages with usage examples on every exit path (previously silent exit 1)

Testing

All four subcommands verified end-to-end:

  • issue view 1
  • label list --limit 3
  • issue list --state open --limit 2
  • search issues "bug report" --limit 2

Same change as anthropics/claude-code-action#996.

- Use allowlist for issue view (numeric issue numbers only)
- Enforce zero positional args for issue list / label list
- Pin GH_HOST and GH_REPO explicitly to avoid ambient state
- Add descriptive error messages with usage examples
@OctavianGuzu OctavianGuzu requested a review from ddworken March 2, 2026 14:06
@OctavianGuzu OctavianGuzu merged commit 38281cf into main Mar 2, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants