Skip to content

Commit

Permalink
Fix creyD#78
Browse files Browse the repository at this point in the history
Fix creyD#78 by updating the regex.

I tested the regex but was not sure how to test the action. The regex should cover all three valid cases outlined here https://prettier.io/docs/en/plugins.html.
  • Loading branch information
bercos authored and levex committed Feb 1, 2022
1 parent b9384f8 commit 40aea42
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ if [ -n "$INPUT_PRETTIER_PLUGINS" ]; then
for plugin in $INPUT_PRETTIER_PLUGINS; do
echo "Checking plugin: $plugin"
# check regex against @prettier/xyz
if ! echo "$plugin" | grep -Eq '(@prettier\/)+(plugin-[a-z\-]+)'; then
if ! echo "$plugin" | grep -Eq '(@prettier\/plugin-|(@[a-z\-]+\/)?prettier-plugin-){1}([a-z\-]+)'; then
echo "$plugin does not seem to be a valid @prettier/plugin-x plugin. Exiting."
exit 1
fi
Expand Down

0 comments on commit 40aea42

Please sign in to comment.