mirror of
https://github.com/yanhao98/renovate-example.git
synced 2025-07-13 04:30:48 +08:00
Initial commit
This commit is contained in:
18
.github/workflows/检查配置.yaml
vendored
Normal file
18
.github/workflows/检查配置.yaml
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
name: Check Renovate Configuration
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: yanhao98/composite-actions/setup-node-environment@main
|
||||||
|
- name: 检查配置
|
||||||
|
run: |
|
||||||
|
pnpm renovate-config-validator
|
||||||
|
pnpm run validator
|
||||||
|
|
||||||
|
- name: for regex
|
||||||
|
run: npx semantic-release@24
|
||||||
|
if: false
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
node_modules
|
1
Dockerfile
Normal file
1
Dockerfile
Normal file
@ -0,0 +1 @@
|
|||||||
|
FROM ghcr.io/yanhao98/composite-actions:0.0.4
|
47
README.md
Normal file
47
README.md
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
# Renovate
|
||||||
|
|
||||||
|
- ❗️ 注意:
|
||||||
|
- Gitea 需要在仓库的【设置】-【协作者】里增加协作者。
|
||||||
|
- GitHub 需要 https://developer.mend.io 里设置。
|
||||||
|
|
||||||
|
|
||||||
|
### Gitea 仓库配置
|
||||||
|
|
||||||
|
https://docs.renovatebot.com/modules/platform/gitea
|
||||||
|
1. 创建一个`Gitea`的账号。 https://git.1-h.cc/admin/users/new
|
||||||
|
2. 创建该账号的`Personal Access Token`。 https://git.1-h.cc/user/settings/applications
|
||||||
|
3. 到仓库的 https://git.1-h.cc/examples/renovate/settings/collaboration 里增加该账号为协作者。
|
||||||
|
4. Github 的 `Token` 不需要勾选任何权限。 https://github.com/settings/tokens
|
||||||
|
|
||||||
|
#### 启动 Renovate
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
name: renovate
|
||||||
|
services:
|
||||||
|
git.1-h.cc:
|
||||||
|
# docker exec -it renovate-git.1-h.cc-1 docker-entrypoint.sh renovate
|
||||||
|
pull_policy: always
|
||||||
|
restart: always
|
||||||
|
network_mode: bridge
|
||||||
|
environment:
|
||||||
|
- LOG_LEVEL=debug
|
||||||
|
- TZ=Asia/Shanghai
|
||||||
|
- RENOVATE_AUTODISCOVER=true
|
||||||
|
- RENOVATE_PLATFORM=gitea
|
||||||
|
- RENOVATE_INCLUDE_MIRRORS=true
|
||||||
|
#
|
||||||
|
- RENOVATE_ENDPOINT=❗️https://git.1-h.cc
|
||||||
|
- RENOVATE_TOKEN=❗️
|
||||||
|
- GITHUB_COM_TOKEN=❗️
|
||||||
|
entrypoint:
|
||||||
|
- /bin/bash
|
||||||
|
image: renovate/renovate:38
|
||||||
|
command: -c "while true; do docker-entrypoint.sh renovate; sleep 8h; done"
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
### 配置参考
|
||||||
|
|
||||||
|
- https://github.com/vuejs/create-vue/blob/main/renovate.json
|
||||||
|
- https://github.com/unjs/renovate-config/blob/main/default.json
|
||||||
|
- https://docs.renovatebot.com/config-presets/#fetching-presets-from-an-http-server
|
54
default.json5
Normal file
54
default.json5
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
{
|
||||||
|
// https://docs.renovatebot.com/configuration-options/
|
||||||
|
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||||
|
"extends": [
|
||||||
|
"config:recommended",
|
||||||
|
"mergeConfidence:all-badges",
|
||||||
|
"group:allNonMajor",
|
||||||
|
":semanticCommitTypeAll(chore)",
|
||||||
|
"customManagers:dockerfileVersions",
|
||||||
|
"customManagers:githubActionsVersions"
|
||||||
|
],
|
||||||
|
"dependencyDashboard": false,
|
||||||
|
"forkProcessing": "enabled",
|
||||||
|
"rangeStrategy": "bump",
|
||||||
|
"labels": [
|
||||||
|
"dependencies"
|
||||||
|
],
|
||||||
|
"packageRules": [
|
||||||
|
{
|
||||||
|
"minimumReleaseAge": "7 days",
|
||||||
|
"matchPackageNames": [
|
||||||
|
"*"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"customManagers": [
|
||||||
|
// https://semantic-release.gitbook.io/semantic-release/usage/installation#notes
|
||||||
|
{
|
||||||
|
"customType": "regex",
|
||||||
|
"description": "Update semantic-release version used by npx",
|
||||||
|
"fileMatch": [
|
||||||
|
"^\\.github/workflows/[^/]+\\.ya?ml$"
|
||||||
|
],
|
||||||
|
"matchStrings": [
|
||||||
|
"\\srun: npx semantic-release@(?<currentValue>.*?)\\s"
|
||||||
|
],
|
||||||
|
"datasourceTemplate": "npm",
|
||||||
|
"depNameTemplate": "semantic-release"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// use-node-version=22.9.0
|
||||||
|
"customType": "regex",
|
||||||
|
"description": "Update Node.js version configured in .npmrc",
|
||||||
|
"fileMatch": [
|
||||||
|
"^\\.npmrc$"
|
||||||
|
],
|
||||||
|
"matchStrings": [
|
||||||
|
"use-node-version=(?<currentValue>.*?)$"
|
||||||
|
],
|
||||||
|
"datasourceTemplate": "node",
|
||||||
|
"depNameTemplate": "node"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
17
package.json
Normal file
17
package.json
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"packageManager": "pnpm@9.11.0",
|
||||||
|
"scripts": {
|
||||||
|
"validator": "renovate-config-validator ./default.json5 --strict",
|
||||||
|
"validator:npx": "npx --yes --package renovate -- renovate-config-validator --strict",
|
||||||
|
"dry-run": "LOG_LEVEL=debug renovate --token= --platform=local --dry-run=full"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"renovate": "^38.98.0",
|
||||||
|
"@murielmay67-1/semantic-release-example": "^1.0.0"
|
||||||
|
},
|
||||||
|
"renovate": {
|
||||||
|
"extends": [
|
||||||
|
"https://git.1-h.cc/examples/renovate-example/raw/branch/main/default.json5"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
6911
pnpm-lock.yaml
generated
Normal file
6911
pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
13
renovate.json5
Normal file
13
renovate.json5
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||||
|
"extends": [
|
||||||
|
"https://git.1-h.cc/examples/renovate-example/raw/branch/main/default.json5",
|
||||||
|
// "schedule:weekly",
|
||||||
|
// ":disablePeerDependencies",
|
||||||
|
// ":disableMajorUpdates",
|
||||||
|
// ":automergeAll",
|
||||||
|
// ":automergeMinor",
|
||||||
|
// "docker:pinDigests",
|
||||||
|
],
|
||||||
|
"dependencyDashboard": true
|
||||||
|
}
|
Reference in New Issue
Block a user