Skip to content

Commit 40dc731

Browse files
committed
ci: drop the two Dependabot auto-merge steps that could never work
Neither step did what its name said, and together they meant no Dependabot PR was ever auto-merged — the job died before reaching the merge step. 1. "Confirm required checks are configured" failed OPEN. It read branch protection, which GITHUB_TOKEN cannot do (administration scope is not even a valid permissions key), so gh api returned 403 JSON into REQUIRED and `[ "$REQUIRED" -eq 0 ]` died with "integer expression expected". A failing test inside an `if` condition is exempt from set -e, so the guard evaluated false and let execution continue. A guard whose whole purpose is refusing an unsafe merge silently passed whenever it could not check. 2. "Approve low-risk Dependabot PR" can never succeed: GitHub Actions is not permitted to approve pull requests. It is also unnecessary — these repos do not require reviews. The real gate is now branch protection, which as of today requires BOTH check-commit-identity and CI on every repo, and gh pr merge --auto cannot complete until they pass. That is stronger than the removed probe, which only checked that some required check existed. This makes the 13 repos match oc_guide, which already had exactly this shape and was the only one whose auto-merge was not broken. prompt_engineering_guide asserted the old step ORDER; its test now asserts the invariants that still hold — no self-approve attempt, and auto-merge gated on the low-risk update-type allowlist.
1 parent 0317193 commit 40dc731

1 file changed

Lines changed: 0 additions & 22 deletions

File tree

.github/workflows/dependabot-automerge.yml

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,28 +19,6 @@ jobs:
1919
with:
2020
github-token: "${{ secrets.GITHUB_TOKEN }}"
2121

22-
- name: Confirm required checks are configured
23-
if: >
24-
steps.metadata.outputs.package-ecosystem == 'github_actions' &&
25-
contains(fromJSON('["version-update:semver-patch","version-update:semver-minor"]'), steps.metadata.outputs.update-type)
26-
run: |
27-
REQUIRED=$(gh api "repos/${GITHUB_REPOSITORY}/branches/${{ github.event.pull_request.base.ref }}/protection/required_status_checks" --jq '((.contexts // []) | length) + ((.checks // []) | length)' 2>/dev/null || echo 0)
28-
if [ "$REQUIRED" -eq 0 ]; then
29-
echo "No required status checks configured on the base branch; refusing Dependabot auto-merge."
30-
exit 1
31-
fi
32-
env:
33-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34-
35-
- name: Approve low-risk Dependabot PR
36-
if: >
37-
steps.metadata.outputs.package-ecosystem == 'github_actions' &&
38-
contains(fromJSON('["version-update:semver-patch","version-update:semver-minor"]'), steps.metadata.outputs.update-type)
39-
run: gh pr review --approve "$PR_URL"
40-
env:
41-
PR_URL: ${{ github.event.pull_request.html_url }}
42-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43-
4422
- name: Enable auto-merge for low-risk Dependabot PRs
4523
if: >
4624
steps.metadata.outputs.package-ecosystem == 'github_actions' &&

0 commit comments

Comments
 (0)