fix: dependabot-auto-merge needs GH_REPO env (no checkout step)#37
Merged
Conversation
… a git repository') 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to PR #36. The added
gh label create/gh pr merge --disable-auto/gh pr editcommands need repo context. The workflow has noactions/checkoutstep, sogherrors out withfatal: not a git repository.Observed on PR #35's auto-merge run at 2026-05-28T21:47:56 — the entire job went red even though all 5 required CI checks were SUCCESS.
Fix
Set
GH_REPO: \${{ github.repository }}on the env block of both steps.ghconsults this env var to resolve the target repo without a.gitdirectory.Test plan