Skip to content

Commit

Permalink
self-validate: allow to define config file as an input
Browse files Browse the repository at this point in the history
  • Loading branch information
roobre committed Nov 15, 2024
1 parent b67997c commit 23c8058
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions .github/workflows/renovate-validate.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
name: Validate renovate config
on: workflow_call
on:
workflow_call:
inputs:
config:
required: false
type: string
default: ""
description: |-
Space-separated list of configs to validate. If empty (recommended), renovate find the config for you.
jobs:
validate:
Expand All @@ -12,4 +20,17 @@ jobs:
run: |
# Renovate updates the line below. Please keep its formatting as it is.
RENOVATE_IMAGE=ghcr.io/renovatebot/renovate:39.17.0@sha256:89ad65038d8898af0f9deb09aec3377396d603e19a4573a844e70c23ddafd954
docker run -i --rm -v "$(realpath .):/repo" -w /repo --entrypoint renovate-config-validator "$RENOVATE_IMAGE" --strict
if [[ -z "${{ inputs.config }}" ]]; then
docker run -i --rm -v "$(realpath .):/repo" -w /repo --entrypoint renovate-config-validator "$RENOVATE_IMAGE" --strict
exit 0
fi
success="true"
for c in "${{ inputs.config }}"; do
if ! docker run -i --rm -v "$(realpath .):/repo" -w /repo --entrypoint renovate-config-validator "$RENOVATE_IMAGE" --strict "$c"; then
echo "::error file=$c,title=Validation failed::Config file did not pass validation"
success="false"
fi
done
[[ "$success" = "true" ]]

0 comments on commit 23c8058

Please sign in to comment.