Repository navigation
ci: let a GitHub App merge Dependabot PRs and add update cooldown - #2226
Merged
Merged
Conversation
Dependabot now holds back new versions for 7 days (except @mittwald/api-client), so compromised releases, which usually ship as patch versions and get yanked within days, are not merged and released automatically on the day they appear. review-dependabot-prs.yml becomes the only workflow that merges Dependabot PRs, replacing automerge.yml, which can no longer approve PRs since GitHub Actions may not approve PRs in this organization. Patch updates, the mittwald-api group and minor updates of development dependencies are fast-tracked; everything else is reviewed by the agent first. Merges use a token of the dependency GitHub App instead of MACHINE_USER_TOKEN. The app bypasses the master ruleset for pull requests, which skips the required review and status checks, so the workflow waits for the checks itself and only bypasses the review for commits signed by Dependabot, commits it pushed itself, and commits that only touch the generated docs. The app's credentials and MITTWALD_AI_API_KEY move to the "dependency-updates" and "ai-agents" environments, so that workflows on other branches cannot read them. Co-Authored-By: Claude Opus 5.5 <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.
GitHub Actions may no longer approve pull requests in this organization, so
automerge.ymlcannot approve Dependabot PRs any more. This PR moves merging Dependabot PRs to a dedicated GitHub App and hardens the setup around it.Update cooldown
Dependabot now only proposes versions that have been public for 7 days, for npm and GitHub Actions. Compromised releases (stolen maintainer tokens, npm worms) usually ship as patch versions and get yanked within hours or days; since patch updates are merged and released automatically, they must not arrive the same day.
@mittwald/api-clientis excluded. Security updates are not affected by the cooldown.One workflow merges Dependabot PRs
review-dependabot-prs.ymlbecomes the only workflow that merges Dependabot PRs;automerge.ymlis removed. It sorts open Dependabot PRs by the metadata in Dependabot's commit:automerge.yml): patch updates, themittwald-apigroup, minor updates of development dependencies. These are merged as soon as the required checks pass, without an agent review.review-dependabot-pr.ymlgets afast-trackinput that skips the review job.GitHub App instead of
MACHINE_USER_TOKENThe apply job uses a short-lived token of the dependency app, limited to the permissions it needs and passed only to the steps that need it (not to the
npx prettierstep). Checkout no longer persists git credentials.The app bypasses the
masterruleset for pull requests. That skips the required review and the required status checks, so the apply job:dependabot[bot], verified by GitHub), commits it pushed itself, and commits that only touchREADME.mdordocs/*.md; merge commits or anything else escalate the PR,Both jobs refuse PRs that are not authored by Dependabot in this repository, including manual dispatches. Fast-tracked PRs that cannot be merged yet (conflicts, moving head) are retried on the next run instead of being escalated; failed checks or unexpected commits escalate them.
Environments
dependency-updates(master only): the app's credentials, used by the apply job.ai-agents(master andv*tags):MITTWALD_AI_API_KEY, used by the review job and the release announcement.The review job runs the dependency's code and never gets the app's key. Environment secrets cannot be passed through
workflow_call, so the jobs reference the environments themselves.🤖 Generated with Claude Code