From 8dd1e681e637f0eb38ea4821ce879f716c226821 Mon Sep 17 00:00:00 2001 From: Chris Knight Date: Mon, 10 Aug 2026 22:06:14 -0400 Subject: [PATCH] Fix release workflow: gh release create needs --repo, no checkout in that job The package-release job runs on a bare ubuntu-latest runner and only downloads build artifacts - it never checks out the repo. Without --repo, gh release create tries to auto-detect the target repository via a local git remote lookup, which fails outright with no working directory to look in. Confirmed by this workflow's first real run (tag v0.6.2): every job through packaging succeeded, and only this step failed with "fatal: not a git repository". Pass --repo "\$GITHUB_REPOSITORY" explicitly instead of adding a checkout step just for this. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01GXAuGMLB44T5Zv5o5ZzKah --- .github/workflows/release.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 64e9033..17ffe6f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -214,6 +214,16 @@ jobs: ( cd publish/WitcherScriptMerger.Headless-win-x64 && zip -r "../../dist/WitcherScriptMerger.Headless-${RELEASE_VERSION}-win-x64.zip" . ) ( cd publish/WitcherScriptMerger.Headless-linux-x64 && tar -czf "../../dist/WitcherScriptMerger.Headless-${RELEASE_VERSION}-linux-x64.tar.gz" . ) + # --repo is required here: this job never checks out the repo (it only downloads + # build artifacts from earlier jobs), so gh has no local git context to + # auto-detect the target repository from - confirmed by the first real run of + # this workflow (tag v0.6.2) failing with "failed to run git: fatal: not a git + # repository (or any of the parent directories): .git" on exactly this step. + # $GITHUB_REPOSITORY (a built-in Actions env var, "owner/repo") sidesteps that + # without needing an actions/checkout step just for this. Same class of mistake + # this repo's own CLAUDE.md already warns about for `gh pr create` run without + # --repo/--base - explicit is required, not optional, for any `gh` invocation + # that can't infer its target from a real git working directory. - name: Create GitHub Release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -224,5 +234,6 @@ jobs: "dist/WitcherScriptMerger-${RELEASE_VERSION}-win-x64.zip" \ "dist/WitcherScriptMerger.Headless-${RELEASE_VERSION}-win-x64.zip" \ "dist/WitcherScriptMerger.Headless-${RELEASE_VERSION}-linux-x64.tar.gz" \ + --repo "$GITHUB_REPOSITORY" \ --title "$GITHUB_REF_NAME" \ --generate-notes