Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: workaround for strict not failing when using RENOVATE_CONFIG_FILE #770

Merged
merged 1 commit into from
Nov 27, 2024
Merged
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
28 changes: 15 additions & 13 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ runs:
if [ "$STRICT" = "true" ]; then
opts=--strict
elif [ "$STRICT" != "false" ]; then
echo '::error:: the input 'strict' must be "true" or "false"'
echo "::error:: the input 'strict' must be \"true\" or \"false\""
exit 1
fi

Expand All @@ -56,22 +56,24 @@ runs:
if [ -z "$file" ]; then
continue
fi
echo "===> RENOVATE_CONFIG_FILE=\"$file\" npx --yes --package \"$pkg\" -c \"renovate-config-validator $opts\"" >&2
RENOVATE_CONFIG_FILE="$file" npx --yes --package "$pkg" -c "renovate-config-validator $opts"
echo "===> npx --yes --package \"$pkg\" -c \"renovate-config-validator $opts $file\"" >&2
npx --yes --package "$pkg" -c "renovate-config-validator $opts $file"
done < <(echo "$CONFIG_FILE_PATH")
exit 0
fi
else

missing=true
for file in .github/renovate.json .github/renovate.json5 .gitlab/renovate.json .gitlab/renovate.json5 .renovaterc.json .renovaterc.json5 renovate.json renovate.json5 .renovaterc; do
if [ -f "$file" ]; then
missing=false
echo "===> RENOVATE_CONFIG_FILE=\"$file\" npx --yes --package \"$pkg\" -c \"renovate-config-validator $opts\"" >&2
RENOVATE_CONFIG_FILE="$file" npx --yes --package "$pkg" -c "renovate-config-validator $opts"
missing=true
for file in .github/renovate.json .github/renovate.json5 .gitlab/renovate.json .gitlab/renovate.json5 .renovaterc.json .renovaterc.json5 renovate.json renovate.json5 .renovaterc; do
if [ -f "$file" ]; then
missing=false
echo "===> npx --yes --package \"$pkg\" -c \"renovate-config-validator $opts $file\"" >&2
echo "===> RENOVATE_CONFIG_FILE=\"$file\" npx --yes --package \"$pkg\" -c \"renovate-config-validator $opts\"" >&2
npx --yes --package "$pkg" -c "renovate-config-validator $opts $file"
fi
done
if [ "$missing" = "true" ]; then
echo "===> No configuration file is found" >&2
fi
done
if [ "$missing" = "true" ]; then
echo "===> No configuration file is found" >&2
fi
shell: bash
env:
Expand Down