From 0d56bd05776969be465f4423fa72e625be4edb78 Mon Sep 17 00:00:00 2001 From: heznpc Date: Fri, 29 May 2026 06:51:23 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20dependabot-auto-merge=20needs=20GH=5FREP?= =?UTF-8?q?O=20env=20(no=20checkout=20step=20=E2=86=92=20'not=20a=20git=20?= =?UTF-8?q?repository')?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR #36 added `gh label create` + `gh pr merge --disable-auto` + `gh pr edit` to the major-update branch but the workflow has no `actions/checkout` step. Without a `.git` directory in the workdir, `gh` errors out with `fatal: not a git repository (or any of the parent directories): .git` before any subcommand runs. Observed on PR #35's auto-merge run (logged 2026-05-28T21:47:56.2681559Z). Two fixes: - Set `GH_REPO: ${{ github.repository }}` on the env block of BOTH steps (`gh` consults this env var to resolve the target repo when no git context is present). - Leaves the minor/patch branch with the same shielding even though its current single command (`gh pr merge --auto --squash`) already accepts a URL argument; defensive symmetry against future additions. No source code changes; workflow-only fix. --- .github/workflows/dependabot-auto-merge.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml index ebd0b15..0cfc649 100644 --- a/.github/workflows/dependabot-auto-merge.yml +++ b/.github/workflows/dependabot-auto-merge.yml @@ -25,6 +25,10 @@ jobs: env: PR_URL: ${{ github.event.pull_request.html_url }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # `gh` resolves the target repo via this env var when no checkout + # is present (no `.git` in workdir). Without it `gh` errors out + # with `fatal: not a git repository`. + GH_REPO: ${{ github.repository }} - name: Label major updates for manual review if: steps.meta.outputs.update-type == 'version-update:semver-major' @@ -46,3 +50,6 @@ jobs: env: PR_URL: ${{ github.event.pull_request.html_url }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # See GH_REPO note above — same `not a git repository` failure + # observed on PR #35 before this env var was added. + GH_REPO: ${{ github.repository }}