Enable Dependabot auto-merge (config + caller workflow)#103
Open
bbkrr wants to merge 6 commits into
Open
Conversation
Add .github/dependabot.yml (pip for setup.py + github-actions, weekly, target develop) and a thin caller of the org reusable auto-merge workflow at .github/workflows/dependabot-automerge.yaml. The repo's dependabot-automerge ruleset already requires a workflow at that path; without a local workflow file the required check was never produced, so Dependabot PRs would be blocked. This adds it. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
github-actions (and docker) ecosystems only support cooldown.default-days, not the semver-*-days keys. Keep default-days; remove the unsupported semver-specific cooldown so Dependabot accepts the config. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Address review feedback: add a job-level 'if: github.actor == dependabot[bot]' guard so inherited secrets are never passed to the reusable workflow for non-Dependabot (incl. fork) PRs, and restrict the pull_request_target trigger to the default branch. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Address re-review: github.actor is the user who triggered the event and can be a maintainer on a rebase/synchronize of the Dependabot branch, which would wrongly skip the job (and leave the ruleset-required check in a non-passing state). Guard on github.event.pull_request.user.login, which can't be forged, so secrets stay away from non-Dependabot/fork PRs while the job still runs for every Dependabot-authored PR. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The org dependabot-automerge ruleset injects .github's Dependabot Auto-Merge workflow into every repo's PRs (required workflows can't be reusable, so per-repo callers are both unnecessary and invalid). Keep only dependabot.yml here; the auto-merge logic is provided org-wide. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The current head was pushed while the org 'require workflows to pass' rule was temporarily disabled, so the required Dependabot Auto-Merge workflow never ran on it. An empty commit fires a fresh synchronize so the injected workflow runs and skips (non-Dependabot PR), satisfying the required check. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
What
Enable Dependabot auto-merge on Causing:
.github/dependabot.yml—pip(repo usessetup.py) +github-actions, weekly,target-branch: develop,dependencieslabel, same cooldown as RealRate-Private..github/workflows/dependabot-automerge.yaml— a thin caller of the org reusable workflow (uses: realrate/.github/.github/workflows/dependabot-automerge.yaml@main,secrets: inherit).Why
Causing already has a
dependabot-automergeruleset whose "require workflows to pass" rule points at the path.github/workflows/dependabot-automerge.yaml. But the repo had no workflow file at that path and nodependabot.yml, so:Adding the caller at that path produces the required check and runs the approve + auto-merge logic (patch/minor); major bumps get
needs-manual-review.Dependency / merge order
The caller references the reusable workflow added in realrate/.github#1 — merge that first so
@mainresolves at runtime.Caveat
Whether a reusable-workflow caller run satisfies a path-based required-workflow ruleset rule is not verifiable until a live Dependabot PR runs. If the required check doesn't post, the fallback is to replace this caller with a self-contained copy of the workflow body (identical to RealRate-Private's).
Part of realrate/RealRate-Private#2148.