Merge pull request #4 from sebastianks/check-plugin-name

Change to sh regex
This commit is contained in:
Sebastian Kolind Sørensen
2021-01-10 17:50:44 +01:00
committed by GitHub

View File

@@ -41,8 +41,7 @@ if [ -n "$INPUT_PRETTIER_PLUGINS" ]; then
for plugin in $INPUT_PRETTIER_PLUGINS; do
echo "checking $plugin"
# check regex against @prettier/xyz
REGEX='(@prettier\/)+(plugin-[a-z\-]+)'
if ! [[ "$plugin" =~ "$REGEX" ]]; then
if ! echo "$plugin" | grep -Eq '(@prettier\/)+(plugin-[a-z\-]+)'; then
echo "$plugin does not seem to be a valid @prettier/plugin-x plugin."
exit 1
fi