From 1da56052e4032cb4ef2c169965670c797571d4a8 Mon Sep 17 00:00:00 2001 From: Robby Rabbitman Date: Sat, 6 Jul 2024 23:20:15 +0200 Subject: [PATCH] ci(tools-renovate-bot): add basic renovate O_O (#9) Co-authored-by: robby rabbitman --- tools/renovate-bot/project.json | 34 +++++++++++++ tools/renovate-bot/src/renovate.json | 72 ++++++++++++++++++++++++++++ 2 files changed, 106 insertions(+) create mode 100644 tools/renovate-bot/project.json create mode 100644 tools/renovate-bot/src/renovate.json diff --git a/tools/renovate-bot/project.json b/tools/renovate-bot/project.json new file mode 100644 index 0000000..c4c7064 --- /dev/null +++ b/tools/renovate-bot/project.json @@ -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" + } + } +} diff --git a/tools/renovate-bot/src/renovate.json b/tools/renovate-bot/src/renovate.json new file mode 100644 index 0000000..1ef2e37 --- /dev/null +++ b/tools/renovate-bot/src/renovate.json @@ -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/"] + } + ] +}