Skip to content

Commit 5399981

Browse files
committed
Validate 'renovate.json' on PRs
Signed-off-by: Alexander Brandes <mc.cache@web.de>
1 parent 474f2aa commit 5399981

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Validate Renovate Configuration
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- '.github/renovate.json'
7+
workflow_dispatch:
8+
9+
jobs:
10+
validate:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
15+
- name: Validate Renovate Configuration
16+
run: |
17+
set -eu
18+
CONFIG_FILE=".github/renovate.json"
19+
if [ ! -f "$CONFIG_FILE" ]; then
20+
echo "Error: Oops! $CONFIG_FILE is absent."
21+
exit 1
22+
fi
23+
npx --yes --package renovate -c "renovate-config-validator --strict $CONFIG_FILE"
24+
shell: bash
25+
26+
- name: Publish checks
27+
if: always()
28+
run: |
29+
if [ "${{ job.status }}" == "success" ]; then
30+
echo "Renovate configuration is valid!"
31+
echo "### ✅ Renovate Configuration Valid" >> $GITHUB_STEP_SUMMARY
32+
echo "The renovate configuration at \`.github/renovate.json\` has been validated successfully." >> $GITHUB_STEP_SUMMARY
33+
else
34+
echo "Renovate configuration validation failed!"
35+
echo "### ❌ Renovate Configuration Invalid" >> $GITHUB_STEP_SUMMARY
36+
echo "The renovate configuration at \`.github/renovate.json\` failed validation." >> $GITHUB_STEP_SUMMARY
37+
echo "" >> $GITHUB_STEP_SUMMARY
38+
echo "Please check the logs above for detailed error messages." >> $GITHUB_STEP_SUMMARY
39+
fi
40+
shell: bash

0 commit comments

Comments
 (0)