Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/validate-renovate-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Validate Renovate config

on:
pull_request:
paths:
- renovate-config.json
- renovate.json
- bin/validate-renovate-config
- .github/workflows/validate-renovate-config.yml
push:
branches:
- main
paths:
- renovate-config.json
- renovate.json
- bin/validate-renovate-config
- .github/workflows/validate-renovate-config.yml

jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: ./bin/validate-renovate-config
25 changes: 25 additions & 0 deletions bin/validate-renovate-config
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash
set -euo pipefail

cd "$(dirname "$0")/.."

files=()
for candidate in renovate-config.json renovate.json; do
[ -f "$candidate" ] && files+=("$candidate")
done

if [ ${#files[@]} -eq 0 ]; then
echo "no renovate config files found; nothing was validated" >&2
exit 1
fi

status=0
for file in "${files[@]}"; do
if ! jq empty "$file" >/dev/null 2>&1; then
echo "$file: not strict JSON" >&2
status=1
fi
done
[ "$status" -eq 0 ] || exit "$status"

npx --yes --package renovate -- renovate-config-validator --strict "${files[@]}"
Loading