From 252004279db939fc2e09ee50d82e0d30ec44a13b Mon Sep 17 00:00:00 2001 From: Maxim Averyanov Date: Wed, 26 Aug 2026 22:56:25 +0200 Subject: [PATCH] Let the helper address the repository itself, and record the rule An empty path now means the repository, which is what you want for reading its description and topics; it was refused along with everything else that did not begin with a slash. .claude/settings.json carries the one permission rule that makes tools/github.sh usable without a prompt. It is checked in rather than kept locally because it is a decision about this project - which single command an assistant may run unattended - and that decision should be visible to anyone reading the repository rather than living in one machine's settings. Co-Authored-By: Claude Opus 5 --- .claude/settings.json | 5 +++++ tools/github.sh | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 .claude/settings.json diff --git a/.claude/settings.json b/.claude/settings.json new file mode 100644 index 0000000..b3d304e --- /dev/null +++ b/.claude/settings.json @@ -0,0 +1,5 @@ +{ + "permissions": { + "allow": ["Bash(bash tools/github.sh:*)"] + } +} diff --git a/tools/github.sh b/tools/github.sh index 841ccb2..1fa2e67 100644 --- a/tools/github.sh +++ b/tools/github.sh @@ -2,6 +2,7 @@ # # One narrow door to this repository's GitHub API. # +# tools/github.sh GET "" (the repository itself) # tools/github.sh GET /pulls # tools/github.sh PUT /pulls/7/merge '{"merge_method":"squash"}' # tools/github.sh POST /releases '{"tag_name":"v1.1.0"}' @@ -38,9 +39,9 @@ case "$METHOD" in esac # A path only, so no amount of creativity redirects this at another repository -# or another host. +# or another host. An empty path is the repository itself. case "$PATH_UNDER_REPO" in - /*) ;; + ""|/*) ;; *) echo "path must start with /" >&2; exit 2 ;; esac case "$PATH_UNDER_REPO" in