Skip to content

Commit 7f313c5

Browse files
jeromechooclaude
andcommitted
Fix release publish: pass --repo to gh (job has no checkout)
The release job downloads artifacts but never checks out the repo, so gh could not infer the repository from a local git remote and failed with "fatal: not a git repository". Pass --repo "$GITHUB_REPOSITORY" on every gh release call. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 6b79d94 commit 7f313c5

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,15 +105,19 @@ jobs:
105105
- name: Publish release
106106
env:
107107
GH_TOKEN: ${{ github.token }}
108+
# This job doesn't check out the repo, so gh can't infer it from a local
109+
# git remote — pass --repo explicitly on every gh call.
108110
run: |
109111
set -euo pipefail
110112
tag="${GITHUB_REF_NAME}"
111-
if gh release view "$tag" >/dev/null 2>&1; then
113+
repo="${GITHUB_REPOSITORY}"
114+
if gh release view "$tag" --repo "$repo" >/dev/null 2>&1; then
112115
echo "Release $tag exists; uploading assets (clobbering)."
113-
gh release upload "$tag" dist/* --clobber
116+
gh release upload "$tag" dist/* --repo "$repo" --clobber
114117
else
115118
echo "Creating release $tag."
116119
gh release create "$tag" \
120+
--repo "$repo" \
117121
--title "$tag" \
118122
--generate-notes \
119123
dist/*

0 commit comments

Comments
 (0)