0
0
mirror of https://github.com/yanhao98/renovate-example.git synced 2025-07-13 05:30:48 +08:00
Files
renovate-example/default.json5

111 lines
5.4 KiB
Plaintext

// https://semver.org/lang/zh-CN/#合法语义化版本的巴科斯范式语法
// https://docs.renovatebot.com/configuration-options/
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:recommended", // https://docs.renovatebot.com/presets-config/#configrecommended
"mergeConfidence:all-badges", // https://docs.renovatebot.com/presets-mergeConfidence/#mergeconfidenceall-badges
"group:recommended", // https://docs.renovatebot.com/presets-group/#grouprecommended
"group:allNonMajor", // https://docs.renovatebot.com/presets-group/#groupallnonmajor
"customManagers:dockerfileVersions", // https://docs.renovatebot.com/presets-customManagers/#custommanagersdockerfileversions
"customManagers:githubActionsVersions", // https://docs.renovatebot.com/presets-customManagers/#custommanagersgithubactionsversions
"helpers:disableTypesNodeMajor", // https://docs.renovatebot.com/presets-helpers/#helpersdisabletypesnodemajor
":widenPeerDependencies", // https://docs.renovatebot.com/presets-default/#widenpeerdependencies
":disablePeerDependencies", // https://docs.renovatebot.com/presets-default/#disablepeerdependencies
":prConcurrentLimitNone", // 取消并发 PR 限制
":semanticCommitTypeAll(chore)" // 统一使用 chore 作为 commit 类型
],
"vulnerabilityAlerts": { "enabled": true, "labels": ["security"], "automerge": false, "schedule": "at any time" },
"platformAutomerge": true, // https://docs.renovatebot.com/configuration-options/#platformautomerge
"labels": [ "dependencies" ],
"dependencyDashboard": false,
"forkProcessing": "enabled",
"rangeStrategy": "bump",
"internalChecksFilter": "none", // https://docs.renovatebot.com/configuration-options/#internalchecksfilter
"packageRules": [
{ "minimumReleaseAge": "14 days", "matchPackageNames": [ "*" ] },
{ "groupName": "devDependencies",
"matchDepTypes": ["devDependencies", "dev-dependencies", "dev"],
"matchPackageNames": [ "pnpm" ]
},
// It's easier to deal with all the Vite plugins at once when Vite ships a new major version
{ "groupName": "vite packages", "extends": ["packages:vite"] },
{ "groupName": "primevue pkgs", "matchPackageNames": ["/prime/"] },
// TypeScript doesn't follow semver, so we need to separate minor and patch updates
// <https://www.semver-ts.org/1-background.html>
{ "groupName": "typescript", "matchDepNames": ["typescript"], "separateMinorPatch": true, "separateMultipleMinor": true },
// Prettier, when used as a devDependency to format code, should be pinned.
// SemVer only applies to its API, not its formatting behavior.
{ "groupName": "prettier", "matchDepNames": ["prettier"], "matchDepTypes": ["devDependencies"], "rangeStrategy": "pin" },
// Minor releases for v0.x packages may contain breaking changes
{ "groupName": "v0.x", "matchCurrentVersion": "/^0./", "separateMinorPatch": true },
{ "groupName": "github-actions", "matchManagers": [ "github-actions" ] },
{ "groupName": "Dockerfile", "matchManagers": [ "dockerfile" ] },
{ "groupName": "types", "matchPackageNames": [ "/^@types//" ], "minimumReleaseAge": "1 days" },
// https://grok.com/chat/68971467-db9f-4e92-b69f-e81431250d3b
{
"groupName": "Lint dependencies", "groupSlug": "lint",
"matchPackageNames": [ "/eslint/", "/oxlint/" ]
// "schedule": ["before 4am on Monday"],
// "automerge": true
},
// https://grok.com/chat/d407656c-c0b6-445a-be83-a13c7c39ccba
{
"groupName": "unplugin packages",
"description": "Group all unplugin-related dependencies",
"matchPackageNames": [
"/^unplugin-/",
"@intlify/unplugin-vue-i18n"
]
// "schedule": ["before 4am on Monday"]
// "automerge": true,
// "automergeType": "branch"
},
{
"groupName": "Playwright packages",
"groupSlug": "playwright",
"description": "Group Playwright core and related packages",
"matchPackageNames": [
"mcr.microsoft.com/playwright", // CI 的 Playwright 镜像
"/^@playwright\\//", // 匹配所有 @playwright/ 开头的包,例如 @playwright/test
"playwright" // 匹配核心包 playwright
],
"minimumReleaseAge": "3 days" // 设置 Playwright 相关包的发布稳定期为 3 天
}
// major 更新需要人工确认
// { "matchUpdateTypes": ["major"], "dependencyDashboardApproval": true },
],
// "commitBody": "[skip ci]", // 根据 CI 配置调整
"customManagers": [
// https://semantic-release.gitbook.io/semantic-release/usage/installation#notes
/* === run: npx semantic-release@24.2.1 === */
{
"customType": "regex",
"description": "Update semantic-release version used by npx",
"fileMatch": [ "^\\.github/workflows/[^/]+\\.ya?ml$", "^default\\.json5$" ],
"matchStrings": [ "\\srun: npx semantic-release@(?<currentValue>.*?)\\s" ],
"datasourceTemplate": "npm",
"depNameTemplate": "semantic-release"
},
{
"customType": "regex",
"description": "更新 .npmrc 中配置的 Node.js 版本。匹配 use-node-version=22.9.0",
"fileMatch": [ "^\\.npmrc$" , "^default\\.json5$" ],
"matchStrings": [ "use-node-version=(?<currentValue>.*?)\\s" ],
"datasourceTemplate": "node",
"depNameTemplate": "node"
}
]
}