From 9dff813935c90d4015c2a80f7d87a65751b1939c Mon Sep 17 00:00:00 2001 From: Bernie Cosgriff <56446898+bercos@users.noreply.github.com> Date: Fri, 14 Jan 2022 16:27:39 -0700 Subject: [PATCH] Fix #78 Fix https://github.com/creyD/prettier_action/issues/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. --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index b31f096..d3242fe 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -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