Skip to content

Commit 1ddf546

Browse files
authored
feat(renovate): add renovate config validator shared action (#1380)
* Add renovate config validator shared action * Modify run to avoid template injection * add newline to renovate action * Update prettier fixes from local * Update renovate README example versions
1 parent 96e4673 commit 1ddf546

File tree

4 files changed

+79
-1
lines changed

4 files changed

+79
-1
lines changed

.release-please-manifest.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,6 @@
2323
"actions/get-latest-workflow-artifact": "0.2.0",
2424
"actions/create-github-app-token": "0.2.0",
2525
"actions/run-capslock": "0.2.0",
26-
"actions/azure-trusted-signing": "1.0.0"
26+
"actions/azure-trusted-signing": "1.0.0",
27+
"actions/validate-renovate-config": "0.1.0"
2728
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# validate-renovate-config
2+
3+
Validates Renovate configuration files using [renovate-config-validator](https://docs.renovatebot.com/config-validation/).
4+
5+
## Inputs
6+
7+
- `path`: Path to the Renovate config file to validate. Defaults to `renovate.json`.
8+
9+
## Example workflow
10+
11+
```yaml
12+
name: Validate Renovate Config
13+
14+
on:
15+
pull_request:
16+
paths:
17+
- "renovate.json"
18+
push:
19+
branches:
20+
- main
21+
paths:
22+
- "renovate.json"
23+
24+
jobs:
25+
validate:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v4
30+
with:
31+
persist-credentials: false
32+
- name: Validate Renovate Config
33+
uses: grafana/shared-workflows/actions/validate-renovate-config@validate-renovate-config/v0.1.0
34+
```
35+
36+
## Validating multiple files
37+
38+
To validate multiple config files, call the action multiple times:
39+
40+
```yaml
41+
- name: Validate main config
42+
uses: grafana/shared-workflows/actions/validate-renovate-config@validate-renovate-config/v0.1.0
43+
with:
44+
path: renovate.json
45+
46+
- name: Validate preset
47+
uses: grafana/shared-workflows/actions/validate-renovate-config@validate-renovate-config/v0.1.0
48+
with:
49+
path: presets/default.json
50+
```
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Validate Renovate Config
2+
description: Validates Renovate configuration files using renovate-config-validator
3+
4+
inputs:
5+
path:
6+
description: Path to the Renovate config file to validate (e.g., 'renovate.json')
7+
required: false
8+
default: renovate.json
9+
10+
runs:
11+
using: composite
12+
steps:
13+
- name: Setup Node.js
14+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
15+
with:
16+
node-version: "20"
17+
18+
- name: Validate Renovate config
19+
shell: bash
20+
run: npx --yes --package renovate -- renovate-config-validator "${CONFIG_PATH}"
21+
env:
22+
CONFIG_PATH: ${{ inputs.path }}

release-please-config.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,11 @@
154154
"actions/create-github-app-token": {
155155
"package-name": "create-github-app-token",
156156
"extra-files": ["README.md"]
157+
},
158+
"actions/validate-renovate-config": {
159+
"package-name": "validate-renovate-config",
160+
"extra-files": ["README.md"],
161+
"initial-version": "0.1.0"
157162
}
158163
},
159164
"release-type": "simple",

0 commit comments

Comments
 (0)