feat: reusable Renovate config validation workflow (renovate-config-validator) #3

Merged
jcabillot merged 4 commits from feat/renovate-config-validate-workflow into main 2026-10-08 17:47:12 -04:00
2 changed files with 56 additions and 0 deletions

No files matched your search

+24
View File
@@ -0,0 +1,24 @@
name: PR Checks
on:
workflow_dispatch:
pull_request:
jobs:
# All workflow yaml parse + renovate-config-validator on central config
validate:
runs-on: ubuntu-latest
container: renovate/renovate:43
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Parse all workflow yaml files
# the renovate image ships its own python + pyyaml
run: |
python3 - <<'EOF'
import glob, yaml
for f in glob.glob('.gitea/workflows/*.yaml'):
with open(f) as fh:
yaml.safe_load(fh.read())
print(f, 'ok')
EOF
- name: Validate central Renovate config
run: renovate-config-validator config.json
+32
View File
@@ -0,0 +1,32 @@
name: Renovate Config Validation
on:
workflow_call:
inputs:
config_path:
description: "Path to the Renovate config to validate (a renovate.json in the calling repo). Non-blocking when absent."
required: false
type: string
default: "renovate.json"
jobs:
validate:
runs-on: ubuntu-latest
container: renovate/renovate:43
steps:
- name: Checkout caller repo
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Validate the repo's Renovate config
run: |
FILE="${{ inputs.config_path }}"
if [ ! -f "$FILE" ]; then
echo "No Renovate config at $FILE — skipping validation (this repo has no renovate.json)."
exit 0
fi
echo "Validating $FILE"
# renovate-config-validator parses the file against the official
# Renovate schema and catches: invalid fields, bad regexes in
# customManagers, forbidden *Template fields (e.g. registryUrlsTemplate),
# malformed packageRules, etc. It does NOT run Renovate itself.
renovate-config-validator "$FILE"