Skip to content

Commit 4c8507c

Browse files
committed
docs: add instructions for using Renovate
Our versioning schema doesn't work with Renovate out of the box. Fortunately it can be configured to handle it fine. Here we add instructions for users so that they can set their Renovate configuration up correctly.
1 parent fc4b684 commit 4c8507c

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

README.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,32 @@ themselves.
99
[scorecard]: https://scorecard.dev/viewer/?uri=github.com/grafana/shared-workflows
1010
[scorecard image]: https://api.scorecard.dev/projects/github.com/grafana/shared-workflows/badge
1111

12+
## Custom Renovate config
13+
14+
This is a monorepo containing several Actions. When we release a workflow, we create a tag `<workflow name>/v<workflow version>`.
15+
16+
While Dependabot can update references to these actions, Renovate can't do it out of the box. It can, however, be configured to do so:
17+
18+
```json5
19+
{
20+
packageRules: [
21+
{
22+
matchPackageNames: ["grafana/shared-workflows"],
23+
versioning: "regex:^(?<compatibility>.*)[-/]v?(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<patch>\\d+)?$",
24+
25+
// By default, the dependency name is the same as the package name. For
26+
// Actions, this is `org/repo`. This means that we'd get all actions from
27+
// `shared-workflows` in the same branch. Our tag scheme contains the name
28+
// of the action being update to as well, so we can grab it from there and
29+
// set the dep name, then put this in the branch name. This should mean
30+
// that each shared workflow is handled separately.
31+
overrideDepName: 'grafana/shared-workflows/{{ lookup (split newVersion "/") 0 }}',
32+
additionalBranchPrefix: "{{depName}}",
33+
},
34+
],
35+
}
36+
```
37+
1238
## Notes
1339

1440
### Configure your IDE to run Prettier
@@ -40,7 +66,7 @@ include a tag in a commend after the SHA, it can update the comment too. For
4066
example:
4167

4268
```yaml
43-
- uses: action/foo@abcdef0123456789abcdef0123456789 # v1.2.3
69+
- uses: action/foo@abcdef0123456789abcdef0123456789 # foo-action/v1.2.3
4470
```
4571
4672
[hardening]: https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-third-party-actions

0 commit comments

Comments
 (0)