Skip to content

ci(dependabot): weekly grouped updates and shared auto-merge for minor and patch - #141

Open
singlerider wants to merge 5 commits into
devfrom
ci/dependabot-weekly-automerge
Open

singlerider wants to merge 5 commits into
devfrom
ci/dependabot-weekly-automerge

Conversation

@singlerider

@singlerider singlerider commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Part of blacklanternsecurity/bbot-enterprise#141.

Change

  • .github/dependabot.yml: cargo, uv, github-actions each run weekly against dev, grouped into one minor/patch PR and one major PR per ecosystem.

  • .github/workflows/dependabot-auto-merge.yml is a caller stub for the shared blacklanternsecurity/CLA/.github/workflows/dependabot-auto-merge.yml (public repo, so public callers can reach it), pinned by SHA. On non-major Dependabot PRs the shared workflow waits for every other check on the head commit, refuses on fail or cancel, then runs gh pr merge --squash --match-head-commit. The caller grants checks: read. No per-repo copy of the logic.

  • Trigger is pull_request, not pull_request_target. Dependabot branches are same-repo, so the privileged context is unnecessary.

Depends on

  • blacklanternsecurity/CLA feat/dependabot-auto-merge merging to main (via feat(ci): host shared test, release, and publish workflows CLA#3). The pinned SHA is already on that branch, and stays valid after a merge commit.
  • Nothing in repo settings. dev carries no required checks (bbot-enterprise#139), so the green gate is in the workflow and "Allow auto-merge" is not needed.

Validation

$ uvx check-jsonschema --builtin-schema vendor.dependabot .github/dependabot.yml
ok -- validation done
$ uvx --from actionlint-py actionlint .github/workflows/dependabot-auto-merge.yml && echo ok
ok
$ uvx zizmor --offline .github/workflows/dependabot-auto-merge.yml
No findings to report. Good job! (1 suppressed)

CI

This PR only touches dependabot config. rust-tests/cli-tests/python-tests fail on upstream/dev c15f523 too (clippy: deprecated fetch_update in src/health.rs:455). Fixed in #139.

Individual dependabot PRs pile up faster than one engineer can review
them and go stale until they conflict (bbot-enterprise#141).

Every ecosystem now runs weekly against dev and opens at most two
grouped PRs: one for minor and patch bumps, one for majors. A
pull_request_target workflow enables auto-merge (squash) on the
minor/patch group so it lands once required checks pass. Majors still
need a human.
@singlerider
singlerider requested a review from en0f October 3, 2026 13:59
The auto-merge job was a byte-identical copy in ten repositories. It now
calls dependabot-auto-merge.yml in blacklanternsecurity/.github, pinned
by SHA, so the fetch-metadata pin and merge policy live in one place.

The trigger moves from pull_request_target to pull_request. Dependabot
branches live in this repository, so the privileged target context was
never needed and zizmor flags it as a dangerous trigger.
@singlerider singlerider changed the title ci(dependabot): group updates weekly and auto-merge minor and patch ci(dependabot): weekly grouped updates and shared auto-merge for minor and patch Oct 3, 2026
blacklanternsecurity/.github is private, so public repositories cannot
call reusable workflows from it and the run failed as a workflow file
issue. The shared workflow lives in blacklanternsecurity/CLA, which is
public and already hosts cla-reusable.yml.
@singlerider singlerider self-assigned this Oct 3, 2026
dev carries no required checks (#139), so gh pr merge --auto would merge
immediately rather than on green. The shared workflow now waits for
every other check on the head commit, refuses on failure or cancel, and
merges with --match-head-commit. The caller grants checks: read so it can
read check state.
Aligns with the SHA the other shared CLA workflows are pinned to. The
auto-merge workflow is unchanged between the two commits.

@en0f en0f left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto-merge can't get past the review rule on dev. dev has an active ruleset ("protecc") that requires a pull request and passing status checks. This PR, which targets dev, shows "At least 1 approving review is required by reviewers with write access." The shared workflow pinned at e532142 waits for checks, then runs gh pr merge --squash straight away. Nothing approves the PR first, so that merge call will be rejected every time.

The workflow and the PR description both assume "dev carries no required checks (#139)". The ruleset says otherwise: on this PR, Python Tests and Rust Tests are marked Required.

Fix: either have the shared workflow approve the PR (gh pr review --approve) before merging, with "Allow GitHub Actions to create and approve pull requests" turned on, or add a bypass for this path in the ruleset. I couldn't see the ruleset's bypass list. If GitHub Actions is already on it, this isn't a problem.

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.

2 participants