From 9470db39e52d90a995b424f8172383d6bca9b807 Mon Sep 17 00:00:00 2001 From: Richard Zhuang Date: Tue, 10 Mar 2026 11:13:07 -0700 Subject: [PATCH] fix: use git remote instead of gh repo view for fork detection gh repo view resolves to the upstream parent repo for forks, causing the Actions permissions API call to fail with a 403. Using git remote get-url origin correctly resolves to the user's own fork. Co-Authored-By: Claude Opus 4.6 --- CLAUDE.md | 2 +- setup.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index f29e89b..2e133c0 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -2,7 +2,7 @@ ## Config -- **Timezone**: TIMEZONE_PLACEHOLDER +- **Timezone**: America/Los_Angeles ## What This Repo Is diff --git a/setup.sh b/setup.sh index 87a78f6..2363c8f 100755 --- a/setup.sh +++ b/setup.sh @@ -20,7 +20,7 @@ if ! git rev-parse --is-inside-work-tree &> /dev/null; then exit 1 fi -REPO=$(gh repo view --json nameWithOwner -q .nameWithOwner 2>/dev/null || true) +REPO=$(git remote get-url origin 2>/dev/null | sed 's|.*github.com[:/]||;s|\.git$||' || true) if [ -z "$REPO" ]; then echo "Error: Could not detect GitHub repo. Make sure this repo has a remote."