diff --git a/.github/workflows/renovate-config.yml b/.github/workflows/renovate-config.yml new file mode 100644 index 0000000..e957767 --- /dev/null +++ b/.github/workflows/renovate-config.yml @@ -0,0 +1,36 @@ +name: Validate Renovate preset + +on: + pull_request: + paths: + - renovate-config.json + - .github/workflows/renovate-config.yml + push: + branches: [main] + paths: + - renovate-config.json + - .github/workflows/renovate-config.yml + +permissions: {} + +jobs: + validate: + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 + with: + node-version: 24 + # Every DIRACGrid repo extends this file: a broken preset breaks Renovate everywhere at once. + # Copied to renovate.json so it is checked as repository config, which is how repos consume it + # (given an arbitrary file name, the validator checks it as global config instead). + - name: Validate renovate-config.json + run: | + mkdir "$RUNNER_TEMP/preset" + cp renovate-config.json "$RUNNER_TEMP/preset/renovate.json" + cd "$RUNNER_TEMP/preset" + npx --yes --package renovate@44.243.0 -- renovate-config-validator --strict diff --git a/renovate-config.json b/renovate-config.json new file mode 100644 index 0000000..353005a --- /dev/null +++ b/renovate-config.json @@ -0,0 +1,37 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "description": [ + "DIRACGrid default Renovate policy.", + "Adopt with: {\"extends\": [\"local>DIRACGrid/.github//renovate-config\"]}.", + "Repos with maintained release branches also set baseBranchPatterns, e.g. [\"$default\", \"/^rel-/\"]." + ], + "extends": [ + "config:recommended", + "helpers:pinGitHubActionDigests", + ":configMigration" + ], + "labels": ["dependencies"], + "minimumReleaseAge": "7 days", + "lockFileMaintenance": { + "enabled": true + }, + "packageRules": [ + { + "description": "Do not hold back our own Actions, reusable workflows and images: the cooldown is for third-party code, and our refs pinned to a branch (e.g. `@ # main`) have no release timestamp, so the cooldown would block their digest updates forever.", + "matchPackageNames": ["DIRACGrid/**", "ghcr.io/diracgrid/**"], + "minimumReleaseAge": null + }, + { + "description": "Group all GitHub Actions updates together.", + "matchManagers": ["github-actions"], + "groupName": "GitHub Actions", + "addLabels": ["github-actions"] + }, + { + "description": "Lock file maintenance re-resolves everything to the newest version and skips minimumReleaseAge, so only the package manager can enforce a cooldown. pixi does it with `exclude-newer = \"7d\"` in pixi.toml / [tool.pixi.workspace] (set it in every pixi repo); npm has no rolling equivalent, so its lock files are not refreshed blindly.", + "matchManagers": ["npm"], + "matchUpdateTypes": ["lockFileMaintenance"], + "enabled": false + } + ] +}