Skip to content

Commit

Permalink
chore: udpate configuration for renovate (#690)
Browse files Browse the repository at this point in the history
* chore: udpate configuration for renovate

Signed-off-by: ivan katliarchuk <[email protected]>

* chore: udpate configuration for renovate

Signed-off-by: ivan katliarchuk <[email protected]>

---------

Signed-off-by: ivan katliarchuk <[email protected]>
  • Loading branch information
ivankatliarchuk authored Mar 23, 2024
1 parent 26d79d6 commit 8d1a3c1
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 21 deletions.
4 changes: 3 additions & 1 deletion .envrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# macOs only https://github.com/sorah/envchain
# https://github.com/settings/tokens
# envchain --set --noecho github RENOVATE_TOKEN
# envchain --set --noecho github DOCKER_HUB_USERNAME
# https://hub.docker.com/settings/security?generateToken=true
# envchain --set github DOCKER_HUB_USERNAME
# envchain --set --noecho github DOCKER_HUB_TOKEN
export RENOVATE_TOKEN=$(envchain github env | grep RENOVATE_TOKEN | cut -d'=' -f2)
export RENOVATE_DOCKER_HUB_USERNAME=$(envchain github env | grep DOCKER_HUB_USERNAME | cut -d'=' -f2)
Expand Down
4 changes: 2 additions & 2 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ exclude-labels:
- invalid
- '[skip-changelog]'
- '[skip-ci]'
- 'plugin'
- 'skip-ci'
- 'skip-release'
# group them
- 'github-action'
- 'pre-commit'

autolabeler:
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ SHELL := /bin/bash
MAKEFLAGS += --warn-undefined-variables
MAKEFLAGS += --no-builtin-rules

CI_RENOVATE_IMAGE := renovate/renovate:37.125.2-slim
CI_RENOVATE_IMAGE := renovate/renovate:37.267.0-slim
RENOVATE_REPOSITORIES := $(shell cat ./renovate/repositories.json | jq -r '. | join(",")')
RENOVATE_DRY_RUN := false
LOG_LEVEL := debug
Expand All @@ -20,7 +20,7 @@ hooks: ## Setup pre commit.
validate: ## Validate files with pre-commit hooks
@pre-commit run --all-files

deps: ## Run renovate locally
run: ## Run renovate locally
docker run --rm -it \
-w /tmp \
-v ${PWD}/renovate/config.js:/ren/renovate-config.js \
Expand Down
48 changes: 32 additions & 16 deletions renovate/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,12 @@ module.exports = {
"pre-commit": {
"enabled": true
},
"labels": ["renovate", "deps", "{{depType}}", "datasource::{{datasource}}", "type::{{updateType}}", "manager:{{manager}}"]
"labels": ["renovate", "deps", "{{depType}}", "datasource::{{datasource}}", "type::{{updateType}}", "manager:{{manager}}"],
"ignorePaths": [
"examples/**",
"k8s/sandbox/**",
"**/tests/**",
],
"vulnerabilityAlerts": {
"enabled": true,
"addLabels": ["vulnerability"]
Expand All @@ -70,29 +75,26 @@ module.exports = {
"enabled": false
},
{
"automerge": false,
"automerge": true,
"major": { "enabled": true },
"separateMajorMinor": true,
"separateMinorPatch": true,
"matchDatasources": ["docker"],
"separateMultipleMajor": true,
"groupName": "{{datasource}}",
"addLabels": ["rule::4"],
"addLabels": ["{{datasource}}", "{{updateType}}"]
"addLabels": ["rule::4"]
},
{
"matchPackageNames": ["actions/*"],
"automerge": true,
// https://docs.renovatebot.com/configuration-options/#excluderepositories
"excludeRepositories": ["ivankatliarchuk/.github", "**/*-archived"],
"matchManagers": ["github-actions"],
"additionalBranchPrefix": "{{packageFileDir}}-",
"separateMajorMinor": true,
"separateMinorPatch": true,
"separateMultipleMajor": true,
"groupName": "{{datasource}} {{depType}} {{packageFile}}",
"addLabels": ["rule::4", "github-action"]
},
{
"matchManagers": ["github-actions"],
"addLabels": ["rule::4.1", "github-action"]
"addLabels": ["rule::4.1", "github-action", "skip-release"]
},
{
"automerge": false,
Expand Down Expand Up @@ -128,16 +130,18 @@ module.exports = {
"addLabels": ["rule::8"]
},
{
"automerge": true,
"groupName": "pre-commit",
"matchManagers": ["pre-commit"],
"addLabels": ["rule::10", "pre-commit"]
"commitMessageSuffix": "[skip ci]",
"addLabels": ["rule::10", "pre-commit", "skip-release", "skip-ci"]
},
// legacy
{
"versioning": "regex:^v(?<major>\\d+)(\\.(?<minor>\\d+))?(\\.(?<patch>\\d+))?",
"groupName": "actions",
"matchPackageNames": ["actions/*"],
"addLabels": ["rule::4.2", "github-action"]
"addLabels": ["rule::4.21", "github-action"]
},
{
"versioning": "semver",
Expand Down Expand Up @@ -247,14 +251,14 @@ module.exports = {
},
{
"customType": "regex",
fileMatch: [
"fileMatch": [
"^Dockerfile$",
"Dockerfile$",
],
matchStrings: [
"matchStrings": [
"#\\s*renovate:\\s*datasource=(?<datasource>.*?) depName=(?<depName>.*?)( versioning=(?<versioning>.*?))?\\s(ARG|ENV) .*?_VERSION(=|\\s)(?<currentValue>.*)\\s"
],
versioningTemplate: "{{#if versioning}}{{{versioning}}}{{else}}semver{{/if}}"
"versioningTemplate": "{{#if versioning}}{{{versioning}}}{{else}}semver{{/if}}"
},
{
"customType": "regex",
Expand Down Expand Up @@ -299,6 +303,18 @@ module.exports = {
],
"datasourceTemplate": "docker",
"versioningTemplate": "docker"
}
},
{
"customType": "regex",
"description": "Update .tflint.hcl dependencies",
"fileMatch": [
".tflint.hcl"
],
"matchStrings": [
"plugin \"aws\" {\\n\\s*enabled\\s*=\\s*true\\n\\s*version\\s=\\s*\"(?<currentValue>[a-z.]+)\"\\n\\s * source\\s*=\\s*\"github.com\\/(?<depName>.*?)\"\\n}"
],
"datasourceTemplate": "github-tags",
"versioningTemplate": "semver"
},
]
};

0 comments on commit 8d1a3c1

Please sign in to comment.