Skip to content

fix(github): allowlist remote detection in triage-prs - #85

Merged
cblecker merged 1 commit into
mainfrom
claude/github-triage-prs-permissions-3rmy87
Aug 6, 2026
Merged

fix(github): allowlist remote detection in triage-prs#85
cblecker merged 1 commit into
mainfrom
claude/github-triage-prs-permissions-3rmy87

Conversation

@cblecker

@cblecker cblecker commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Problem

/github:triage-prs failed on every invocation, before doing any work:

Error: Shell command permission check failed for pattern "!`git remote get-url upstream 2>/dev/null || git remote get-url origin 2>/dev/null || echo __NO_REMOTE__`": This Bash command contains multiple operations. The following parts require approval: git remote get-url upstream, git remote get-url origin

The skill's Repo Context section detects the target repo with a pre-execution
! command. The permission checker splits compound commands on || and
validates each part independently, and the skill's allowed-tools had no
Bash(git remote ...) entry at all — so both git remote get-url parts came
back as requiring approval. The trailing echo was already safe by default,
which is why the error names only the two git parts.

Fix

Allowlist the split parts rather than restructuring the command:

allowed-tools:
  - Bash(git remote get-url *)

The command in the skill body is unchanged. Keeping the chained form keeps
detection deterministic — the shell picks upstream over origin and emits a
single URL or the __NO_REMOTE__ sentinel, including when run outside a git
repository — so Phase 1 parses one value instead of choosing between remotes
itself.

A wildcard on the remote name covers both parts in one entry without widening
beyond reads: get-url only accepts a remote name plus --push/--all and has
no mutating form (that's set-url/add/remove), and operator injection is
caught by the same command splitting that caused this bug. It also matches the
existing convention in review-pr, which uses Bash(git diff *).

Two alternatives were tried and dropped: restructuring to a single
git remote -v moved the upstream/origin preference out of the shell and
into the model's reading of a multi-line table, and leaked
fatal: not a git repository into context where the sentinel had handled it;
listing upstream and origin as separate exact entries needed three lines to
do what one does.

Version bumped 1.3.01.3.1 (patch — bug fix, no behavior change to the
skill's logic).

Validation

  • claude plugin validate . — passed
  • claude plugin validate ./github — passed
  • npx markdownlint-cli2 --config .markdownlint-cli2.jsonc "github/**/*.md" — exit 0
  • uvx skillsaw --strict — 0 errors, 0 warnings, grade A

Note

pr-review-toolkit/skills/review-pr/SKILL.md:30 has the same latent failure —
!`git remote get-url origin 2>/dev/null || echo __NO_ORIGIN_REMOTE__` with no
Bash(git remote ...) entry in its allowed-tools. Left out of this PR since
it's a separate plugin needing its own version bump; the same one-line entry
would fix it.

🤖 Generated with Claude Code

https://claude.ai/code/session_0195QVgZcRJjTBKKDJQjoEr3


Generated by Claude Code

Summary by CodeRabbit

  • Chores
    • Updated the GitHub plugin to version 1.3.1.
    • Improved pull request triage guidance to support checking configured remote URLs.

The skill's pre-execution remote detection failed its permission check on
every invocation. The checker splits compound commands on `||` and
validates each part independently, and the skill's `allowed-tools` had no
`Bash(git remote ...)` entry at all, so both `git remote get-url` parts
came back as requiring approval. The trailing `echo` was already safe by
default.

Allowlist the split parts rather than restructuring the command. The
chained form is deterministic — the shell picks `upstream` over `origin`
and emits a single URL or the `__NO_REMOTE__` sentinel, including when
run outside a git repository — so Phase 1 parses one value instead of
choosing between remotes itself. `get-url` is read-only, so a wildcard on
the remote name covers both parts without widening beyond reads.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0195QVgZcRJjTBKKDJQjoEr3
Copilot AI balanced review requested due to automatic review settings August 6, 2026 00:59
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: a317761f-26f5-4f18-ab9b-66f00c8df184

📥 Commits

Reviewing files that changed from the base of the PR and between d8dfce5 and 7f7a091.

📒 Files selected for processing (2)
  • github/.claude-plugin/plugin.json
  • github/skills/triage-prs/SKILL.md

📝 Walkthrough

Walkthrough

The GitHub plugin version changed from 1.3.0 to 1.3.1. The triage-prs skill now allows Bash commands matching git remote get-url *.

Changes

GitHub plugin update

Layer / File(s) Summary
Plugin release configuration
github/.claude-plugin/plugin.json, github/skills/triage-prs/SKILL.md
The plugin version changed to 1.3.1. The triage skill allowed Bash commands now include git remote get-url *.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Possibly related PRs

Suggested reviewers: copilot

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: allowing remote detection in the triage-prs skill.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/github-triage-prs-permissions-3rmy87

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes /github:triage-prs remote detection by granting the required read-only Git command permission.

Changes:

  • Allowlisted git remote get-url commands.
  • Bumped the GitHub plugin patch version to 1.3.1.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
github/skills/triage-prs/SKILL.md Adds the remote URL lookup permission.
github/.claude-plugin/plugin.json Applies the patch version bump.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@cblecker
cblecker merged commit 46cead8 into main Aug 6, 2026
14 checks passed
@cblecker
cblecker deleted the claude/github-triage-prs-permissions-3rmy87 branch August 6, 2026 01:04
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