Skip to content

Commit 3b3359d

Browse files
soodokuclaude
andauthored
Give gh a repo to talk to, so the label step stops failing (#20)
The label-based sweep has never once run its write path. `automerge-eligible` exists in no repo in the fleet, and every scheduled sweep since the design landed reports `sweep acted on 0 PR(s)` -- because the sweep's first branch is `if label not in names`, and the label is never applied. appeler/pranaam#35, run 31283649110, has the whole story: ecosystem=uv group=security update-type=version-update:semver-minor eligible=true Run gh label create "$ELIGIBLE_LABEL" --force ... failed to run git: fatal: not a git repository ##[error]Process completed with exit code 1 Neither job checks out the repo; they do not need the code. Every other gh call passes a full PR URL and resolves the repo from the argument. `gh label create` takes no URL, so it falls back to reading a git remote, finds none, and exits 1. Under `bash -e` that kills the step, so `gh pr edit --add-label` never runs, and a failed step aborts the job, so the arming step never runs either. Reproduced outside CI in an empty directory -- same error string -- and confirmed that GH_REPO alone fixes it. Set at workflow level rather than on the one broken step: the sweep job was already setting it on two of its steps, so this removes that duplication and makes the next gh call added to either job correct by default. Fixed first in finite-sample/calibre#12; this is the same file. Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
1 parent 3c990da commit 3b3359d

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

.github/workflows/dependabot-auto-merge.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ env:
3636
# loud. Silence is the failure mode this workflow exists to fix, so a sweep
3737
# that quietly does nothing must still leave a mark.
3838
STALE_AFTER_HOURS: 12
39+
# Neither job checks out the repo, so gh has no git remote to infer from.
40+
# Steps that pass a PR URL resolve the repo from the argument; `gh label
41+
# create` takes no URL, so it fell back to git and exited 1 -- on every
42+
# eligible PR the fleet ever saw. Set once here rather than per step: the
43+
# next gh call added to either job is then correct by default.
44+
GH_REPO: ${{ github.repository }}
3945

4046
jobs:
4147
classify:
@@ -144,7 +150,6 @@ jobs:
144150
- name: Collect open Dependabot PRs
145151
env:
146152
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
147-
GH_REPO: ${{ github.repository }}
148153
run: |
149154
gh pr list --author "app/dependabot" --state open --limit 100 \
150155
--json number,url,title,labels,autoMergeRequest,mergeStateStatus,statusCheckRollup,createdAt \
@@ -251,7 +256,6 @@ jobs:
251256
- name: Arm or land
252257
env:
253258
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
254-
GH_REPO: ${{ github.repository }}
255259
run: |
256260
acted=0
257261
while IFS=$'\t' read -r n act _rest; do

0 commit comments

Comments
 (0)