Feature/scala steward / dependabot cooldown#25
Open
marcin-jozefowicz wants to merge 2 commits into
Open
Conversation
Introduce a central default.scala-steward.conf carrying a 3-day supply-chain cooldown (updates.cooldown.minimumAge) and wire it into the reusable scala-steward workflow via a sparse checkout, passed as repo-config. Per-repo .scala-steward.conf (pins/ignores) is still auto-discovered and deep-merged on top, taking precedence per field. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
A central, self-maintaining workflow in this repo that enforces a supply-chain cooldown across the org's Dependabot configs. Dependabot has no org-wide config, so a cooldown block must live in each repo's committed .github/dependabot.yml. The workflow discovers target repos via a GitHub App installation (active, non-fork repos that carry a Dependabot config), then fans out a matrix: one job per repo mints a short-lived, repo-scoped App token, patches cooldown.default-days on every updates: entry, and opens a PR. The patch is surgical (per updates: entry, preserving comments and key order) and strict (the central value wins over any local one). PRs are opened with the App token so the target repo's CI runs on them, and are left for review (no auto-merge). Requires a GitHub App exposed as vars.DEPENDABOT_COOLDOWN_APP_CLIENT_ID and secrets.DEPENDABOT_COOLDOWN_APP_KEY. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
marcin-jozefowicz
force-pushed
the
feature/scala-steward-cooldown
branch
from
July 21, 2026 09:55
483a2a4 to
e936d7f
Compare
marcin-jozefowicz
marked this pull request as ready for review
July 21, 2026 11:50
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.
Supply-chain cooldown for Scala Steward + Dependabot
Introduces a cooldown (maturation delay) so new dependency versions aren't adopted the moment they're published — a compromised release has time to be detected first. Security updates (GHSA/CVE advisories) are unaffected and stay fast. Two independent parts, one per toolchain.
Scala Steward (Scala repos)
What: a central
default.scala-steward.confwithupdates.cooldown.minimumAge = "3 days", wired into the reusablescala-steward.yml(sparse-checkout of this repo, passed asrepo-config).How it works:
scala-steward.yml— no per-repo change needed..scala-steward.conf(pins/ignores/overrides) is still auto-discovered and deep-merged per field on top, so local settings keep working alongside the central cooldown.Dependabot (non-Scala repos)
1. Overview & rationale
Adds a central, self-maintaining workflow (
.github/workflows/dependabot-cooldown.yml) that enforces the cooldown on the org's Dependabot configs..github/dependabot.yml.cooldown.default-dayson everyupdates:entry viayq, preserving comments, key order, and sibling keys. Strict: the central value wins over any local one.2. Prerequisites — one-time GitHub App setup (org admin)
The workflow writes to other repos, which
GITHUB_TOKENcan't. A GitHub App is used instead; its private key is the only standing secret, and every token it mints is short-lived (~1h) and repo-scoped.sml-dependabot-cooldown); webhook off..pem).softwaremill). The App can only discover and patch repos it is installed on, so this step defines the fleet: pick All repositories (self-maintaining as new repos appear; the workflow's filters narrow it) or Only select repositories (tighter, but a list you maintain).DEPENDABOT_COOLDOWN_APP_CLIENT_ID(client ID) + secretDEPENDABOT_COOLDOWN_APP_KEY(full.pem).3. How it works
EXCLUDElist → emits a matrix.cooldown.default-days, and opens a PR on a fixed branch (chore/dependabot-cooldown, force-pushed so re-runs update the same PR).PRs are opened with the App token, so the target repo's CI runs on them (unlike
GITHUB_TOKEN). PRs are left for review — not auto-merged. A repo with no Dependabot config is a no-op.4. Triggering
Schedule: weekly, re-applies the policy and picks up newly added configs.
Manual (
workflow_dispatch, from this repo's Actions tab):cooldown-days3reposTesting & rollout
yq patch verified (Docker
mikefarah/yq:v4.53.3, the runner's version): the exact expression writesdefault-daysas an unquoted int, only the target line changes (comments/order/siblings preserved), and an existing value is overwritten. Surgical + strict, as intended.Rollout: start scoped —
workflow_dispatchwithrepos: '<one-repo>', check the PR, then re-run unscoped. Narrow further via Select repositories install or theEXCLUDElist.