Skip to content

Commit

Permalink
Fix #78
Browse files Browse the repository at this point in the history
Fix #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 committed Jan 14, 2022
1 parent 661230a commit 9dff813
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 9dff813

Please sign in to comment.