Skip to content

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

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

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

Conversation

@OctavianGuzu
Copy link
Copy Markdown
Collaborator

Summary

Tighten up the gh.sh wrapper script used by the issue-triage workflow.

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)

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

- 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 marked this pull request as ready for review March 2, 2026 12:29
@OctavianGuzu OctavianGuzu requested a review from ddworken March 2, 2026 13:03
@OctavianGuzu OctavianGuzu merged commit 31adc1e into main Mar 2, 2026
@OctavianGuzu OctavianGuzu deleted the oct/gh-wrapper-script branch March 2, 2026 16:38
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