-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (43 loc) · 1.83 KB
/
Copy pathvalidate-renovate-config.yml
File metadata and controls
51 lines (43 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Validate Renovate config
on:
pull_request:
branches: [main]
push:
branches: [main]
permissions:
contents: read
jobs:
validate:
name: Validate renovate preset
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- name: Check whether renovate config changed
id: check
run: |
BASE="${{ github.event.pull_request.base.sha || github.event.before }}"
if [ -z "$BASE" ] || [ "$BASE" = "0000000000000000000000000000000000000000" ]; then
echo "No usable diff base, validating to be safe."
echo "relevant=true" >> "$GITHUB_OUTPUT"
elif git diff --name-only "$BASE" "${{ github.sha }}" -- renovate-preset.json renovate.json5 | grep -q .; then
echo "relevant=true" >> "$GITHUB_OUTPUT"
else
echo "relevant=false" >> "$GITHUB_OUTPUT"
fi
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
if: steps.check.outputs.relevant == 'true'
with:
node-version: '24'
- name: Schema and syntax check (renovate-preset.json)
if: steps.check.outputs.relevant == 'true'
run: npx --yes --package renovate -- renovate-config-validator --no-global --strict renovate-preset.json
- name: Schema and syntax check (renovate.json5)
if: steps.check.outputs.relevant == 'true'
run: npx --yes --package renovate -- renovate-config-validator --no-global --strict renovate.json5
- name: Full preset resolution check (renovate-preset.json)
if: steps.check.outputs.relevant == 'true'
env:
RENOVATE_CONFIG_FILE: renovate-preset.json
run: npx --yes --package renovate -- renovate --platform=local --dry-run=extract