Skip to content

Commit

Permalink
Merge remote-tracking branch 'openhpi-cloud/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
jgraichen committed May 15, 2024
2 parents 06001ba + 42c9442 commit 236731a
Show file tree
Hide file tree
Showing 10 changed files with 111 additions and 9 deletions.
6 changes: 6 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,9 @@ end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.{yml,yaml}]
indent_style = space

[*.md]
indent_style = space
15 changes: 15 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: test
on:
push:
pull_request:

jobs:
renovate-config-validator:
runs-on: ubuntu-latest
container:
image: ghcr.io/renovatebot/renovate
options: --user root
steps:
- uses: actions/checkout@v4
- run: ls -lah
- run: renovate-config-validator --strict *.json5
26 changes: 25 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,25 @@
# Shared Renovate Preset
# Shared Renovate Presets

Shared configuration preset for @renovatebot.

```json5 title="renovate.json5"
{
$schema: "https://docs.renovatebot.com/renovate-schema.json",
extends: [
"local>openHPI/renovate-config"
]
}
```

## Validate preset configs locally

```console
$ docker run -it --rm -v .:/usr/src/app --entrypoint renovate-config-validator renovate/renovate --strict *.json5
INFO: Validating default.json5
INFO: Validating go.json5
INFO: Validating node.json5
INFO: Validating ruby.json5
INFO: Validating terraform.json5
INFO: Validating tool-version.json5
INFO: Config validated successfully
```
1 change: 0 additions & 1 deletion default.json5
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
$schema: "https://docs.renovatebot.com/renovate-schema.json",
extends: [
"config:base",
"config:recommended",
"schedule:weekly",
":maintainLockFilesWeekly",
Expand Down
5 changes: 3 additions & 2 deletions go.json5
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
groupName: "golang",
},
],
regexManagers: [
customManagers: [
{
customType: "regex",
fileMatch: ["^\\.github/workflows/[^/]+\\.ya?ml$"],
matchStrings: ['go-version:\\s+"(?<currentValue>.*?)"'],
matchStrings: ['go-version: "(?<currentValue>.*?)"'],
depNameTemplate: "golang",
datasourceTemplate: "golang-version",
},
Expand Down
13 changes: 11 additions & 2 deletions node.json5
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,18 @@
$schema: "https://docs.renovatebot.com/renovate-schema.json",
packageRules: [
{
matchFiles: ["package.json"],
matchFileNames: ["**/package.json"],
matchUpdateTypes: ["minor", "patch"],
groupName: "minor NPM dependencies",
groupName: "NPM dependencies",
},
],
customManagers: [
{
customType: "regex",
fileMatch: ["^\\.github/workflows/[^/]+\\.ya?ml$"],
matchStrings: ['node-version:\\s+"(?<currentValue>.*?)"'],
depNameTemplate: "node",
datasourceTemplate: "node-version",
},
],
}
6 changes: 6 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"local>openhpi-cloud/renovate-config"
]
}
8 changes: 5 additions & 3 deletions ruby.json5
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
$schema: "https://docs.renovatebot.com/renovate-schema.json",
packageRules: [
{
matchFiles: ["Gemfile"],
matchFileNames: ["**/Gemfile"],
matchUpdateTypes: ["minor", "patch"],
groupName: "minor gem dependencies",
groupName: "gems dependencies",
},

// Group updates for ruby, ruby container images, ruby-version
Expand All @@ -14,15 +14,17 @@
groupName: "Ruby",
},
],
regexManagers: [
customManagers: [
{
customType: "regex",
fileMatch: ["^*.gemspec"],
matchStrings: [
".*add.*dependency '(?<depName>.*?)', '(?<currentValue>.*?)'",
],
datasourceTemplate: "rubygems",
},
{
customType: "regex",
fileMatch: ["^\\.github/workflows/[^/]+\\.ya?ml$"],
matchStrings: ['ruby-version:\\s+"(?<currentValue>.*?)"'],
depNameTemplate: "ruby",
Expand Down
18 changes: 18 additions & 0 deletions terraform.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
$schema: "https://docs.renovatebot.com/renovate-schema.json",
packageRules: [
// Group updates for Terraform binaries and hashicorp/terraform
// container images together.
{
groupName: "terraform",
matchPackageNames: ["hashicorp/terraform", "terraform"],
},
// Do not automerge major _and_ minor versions, since minor updates
// can contain breaking changes for Terraform.
{
matchPackageNames: ["hashicorp/terraform", "terraform"],
matchUpdateTypes: ["major", "minor"],
automerge: false,
},
],
}
22 changes: 22 additions & 0 deletions tool-version.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
$schema: "https://docs.renovatebot.com/renovate-schema.json",
packageRules: [
// Strip the "v" prefix from usual GitHub tags/release since asdf
// plugins mostly use raw versions only.
{
matchManagers: ["custom.regex"],
matchFileNames: ["**/.tool-versions"],
extractVersion: "^v?(?<version>.*)$",
},
],
customManagers: [
{
customType: "regex",
fileMatch: [".tool-versions$"],
matchStrings: [
"#\\s*renovate:\\s+datasource=(?<datasource>.*?)\\s+depName=(?<depName>.*?)(\\s+versioning=(?<versioning>.*?))?\\n\\w+\\s+(?<currentValue>.*)",
],
versioningTemplate: "{{#if versioning}}{{{versioning}}}{{else}}semver{{/if}}",
},
],
}

0 comments on commit 236731a

Please sign in to comment.