Skip to content

Commit

Permalink
Merge pull request #433 from KisaragiEffective/ci/catch-renovate-sche…
Browse files Browse the repository at this point in the history
…ma-error
  • Loading branch information
KisaragiEffective authored Jun 7, 2024
2 parents 183581e + 3f32534 commit a631424
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions .github/workflows/validate-renovate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,24 @@ jobs:
echo "npx: $(npx --version)"
echo "installing: $package..."
export H="$(mktemp)"
se="$(mktemp)"
echo '{' >> "$H"
# let's do main part, but avoid pipefail
(npx --yes --package "$package" -- renovate-config-validator --strict || true)\
| ruby -e 'File.open(ENV[?H], ?a) {|r| while gets; puts $_; $> = r if $_.strip == "WARN: Config migration necessary" ;end; }'
js_output_temp="$(mktemp)"
npx --yes --package "$package" -- renovate-config-validator --strict >"$js_output_temp" || true
if grep -e "^ERROR: Found errors in configuration" "$js_output_temp"; then
# hard error
# TODO: collect this as JSON, and display it in more structured way
lf=$'\n'
{
echo '```'
echo "Error(s) has been occurred: ${lf}$(cat "$js_output_temp")"
echo '```'
} | gh pr comment -F - "${URL}"
exit 1
fi
# let's do main part, but avoid pipefail for soft-error about migration
ruby -e 'File.open(ENV[?H], ?a) {|r| while gets; puts $_; $> = r if $_.strip == "WARN: Config migration necessary" ;end; }' <"$js_output_temp"
echo '}' >> "$H"
# exit early if migration is not required
Expand Down

0 comments on commit a631424

Please sign in to comment.