Skip to content

Commit

Permalink
Merge pull request #7 from dafyddj/feat/renovate
Browse files Browse the repository at this point in the history
feat: configure `renovate` within the generated template
  • Loading branch information
dafyddj authored Jan 18, 2024
2 parents 5d0b777 + f7fdc2d commit fe3404a
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 0 deletions.
26 changes: 26 additions & 0 deletions template/.github/renovate.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"enabledManagers": [
"custom.regex",
],
"extends": [
"config:recommended",
":semanticCommitTypeAll(fix)",
],
# there are two match strings to match the two conditions
# * no update needed
# * update needed but not yet applied
# renovate needs to be able to match both conditions for PRs to work properly
"customManagers": [
{
"customType": "regex",
"fileMatch": ["^.copier-answers.yml$"],
"matchStrings": [
"_commit: (?<currentValue>\\S+)\\n_src_path: gh:(?<depName>\\S+)\\n",
"_commit: \\S+ # __copier_update_needed (?<currentValue>\\S+)\\n_src_path: gh:(?<depName>.*)\\n",
],
"datasourceTemplate": "github-tags",
"autoReplaceStringTemplate": "_commit: {{{currentValue}}} # __copier_update_needed {{{newValue}}}\n_src_path: gh:{{{depName}}}\n",
}
]
}
1 change: 1 addition & 0 deletions test/GenerateProject/catalogue.tt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ The following new files/directories were created:
<Test Directory>
----.copier-answers.yml
----.github
--------renovate.json5
--------workflows
------------main.yml
----.pre-commit-config.yaml
Expand Down
26 changes: 26 additions & 0 deletions test/GenerateProject/renovate_json5.tt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"enabledManagers": [
"custom.regex",
],
"extends": [
"config:recommended",
":semanticCommitTypeAll(fix)",
],
# there are two match strings to match the two conditions
# * no update needed
# * update needed but not yet applied
# renovate needs to be able to match both conditions for PRs to work properly
"customManagers": [
{
"customType": "regex",
"fileMatch": ["^.copier-answers.yml$"],
"matchStrings": [
"_commit: (?<currentValue>\\S+)\\n_src_path: gh:(?<depName>\\S+)\\n",
"_commit: \\S+ # __copier_update_needed (?<currentValue>\\S+)\\n_src_path: gh:(?<depName>.*)\\n",
],
"datasourceTemplate": "github-tags",
"autoReplaceStringTemplate": "_commit: {{{currentValue}}} # __copier_update_needed {{{newValue}}}\n_src_path: gh:{{{depName}}}\n",
}
]
}
1 change: 1 addition & 0 deletions test/config.tt
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ config_tt:test/config.tt
copier_yaml:copier.yaml
main_yml:.github/workflows/main.yml
pre-commit_yaml:.pre-commit-config.yaml
renovate_json5:.github/renovate.json5

0 comments on commit fe3404a

Please sign in to comment.