Skip to content

Commit

Permalink
ci(tools-renovate-bot): add basic renovate O_O (#9)
Browse files Browse the repository at this point in the history
Co-authored-by: robby rabbitman <robby.rabbitman+nx-plus@gmail.com>
  • Loading branch information
RobbyRabbitman and robby rabbitman authored Jul 6, 2024
1 parent 541ae44 commit 1da5605
Show file tree
Hide file tree
Showing 2 changed files with 106 additions and 0 deletions.
34 changes: 34 additions & 0 deletions tools/renovate-bot/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"name": "tools-renovate-bot",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"tags": ["scope:node", "type:tool"],
"targets": {
"test": {
"command": "pnpm --package renovate dlx renovate-config-validator --strict {projectRoot}/src/renovate.json"
},
"renovate": {
"executor": "nx:run-commands",
"options": {
"command": "RENOVATE_CONFIG_FILE={projectRoot}/src/renovate.json pnpm dlx renovate"
},
"configurations": {
"ci": {
"env": {
"RENOVATE_PLATFORM": "github",
"RENOVATE_REPOSITORIES": "RobbyRabbitman/nx-plus",
"LOG_LEVEL": "debug"
}
},
"development": {
"env": {
"RENOVATE_PLATFORM": "local",
"RENOVATE_REPOSITORY_CACHE": "reset",
"RENOVATE_DRY_RUN": "full",
"LOG_LEVEL": "debug"
}
}
},
"defaultConfiguration": "ci"
}
}
}
72 changes: 72 additions & 0 deletions tools/renovate-bot/src/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"description": "Renovates this repositories",
"extends": [
"config:recommended",
"npm:unpublishSafe",
":combinePatchMinorReleases",
":semanticCommits",
":semanticCommitTypeAll(chore)",
":semanticCommitScopeDisabled"
],
"onboarding": false,
"requireConfig": "ignored",
"dependencyDashboard": true,
"automerge": true,
"autoApprove": true,
"prHourlyLimit": 0,
"prConcurrentLimit": 1,
"enabledManagers": ["npm"],
"printConfig": true,
"labels": ["renovate"],
"allowedPostUpgradeCommands": ["^(pnpm|find)"],
"postUpgradeTasks": {
"description": "Remove all nested pnpm-lock.yaml files, because renovate calls 'pnpm install --recursive --lockfile-only --ignore-scripts --ignore-pnpmfile' and this will create nested pnpm-lock.yaml files. You could create a pnpm workspace and exclude the projects, but we want renovate to update the nested package.json feels like there should be a better way to do this...",
"commands": ["find . -mindepth 2 -name 'pnpm-lock.yaml' -exec rm -f {} +"],
"fileFilters": ["pnpm-lock.yaml"]
},
"packageRules": [
{
"description": "ignore '@robby-rabbitman/nx-plus-*' packages, as nx release will handle it",
"matchPackagePatterns": ["^@robby-rabbitman/nx-plus-"],
"enabled": false
},
{
"description": "Groups all '@commitlint' packages together",
"groupName": "commitlint",
"matchManagers": ["npm"],
"matchPackagePatterns": ["^@commitlint/"]
},

{
"description": "Groups all 'prettier' packages together",
"groupName": "prettier",
"matchManagers": ["npm"],
"matchPackagePatterns": ["^prettier$", "^prettier-"]
},
{
"description": "Groups all 'eslint' packages together",
"groupName": "eslint",
"matchManagers": ["npm"],
"matchPackagePatterns": ["^eslint", "^@typescript-eslint/"]
},
{
"description": "Groups all 'nx' packages together",
"groupName": "nx",
"matchManagers": ["npm"],
"matchPackagePatterns": ["^@nx/", "^nx$"]
},
{
"description": "Groups all 'jest' packages together",
"groupName": "jest",
"matchManagers": ["npm"],
"matchPackagePatterns": ["^jest$", "^jest-"]
},
{
"description": "Groups all 'swc' packages together",
"groupName": "swc",
"matchManagers": ["npm"],
"matchPackagePatterns": ["^@swc-", "^swc/"]
}
]
}

0 comments on commit 1da5605

Please sign in to comment.