Skip to content

fix: dependabot-auto-merge needs GH_REPO env (no checkout step)#37

Merged
heznpc merged 1 commit into
mainfrom
fix/auto-merge-needs-gh-repo-2026-05-28
May 28, 2026
Merged

fix: dependabot-auto-merge needs GH_REPO env (no checkout step)#37
heznpc merged 1 commit into
mainfrom
fix/auto-merge-needs-gh-repo-2026-05-28

Conversation

@heznpc
Copy link
Copy Markdown
Member

@heznpc heznpc commented May 28, 2026

Follow-up to PR #36. The added gh label create / gh pr merge --disable-auto / gh pr edit commands need repo context. The workflow has no actions/checkout step, so gh errors out with fatal: 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. gh consults this env var to resolve the target repo without a .git directory.

Test plan

  • No source changes — workflow-only
  • Next Dependabot PR fires the auto-merge workflow cleanly

… 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.
@heznpc heznpc enabled auto-merge (squash) May 28, 2026 21:51
@heznpc heznpc merged commit 571a028 into main May 28, 2026
8 checks passed
@heznpc heznpc deleted the fix/auto-merge-needs-gh-repo-2026-05-28 branch May 28, 2026 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant