feat: #98 added option to allow for other plugins

This commit is contained in:
2025-05-08 13:20:52 +02:00
parent b73c2bf29c
commit e2704493af
2 changed files with 15 additions and 8 deletions

View File

@@ -70,6 +70,10 @@ inputs:
description: Which identity is used for git name/email when committing changes. Needs to be one of "actions" or "author". description: Which identity is used for git name/email when committing changes. Needs to be one of "actions" or "author".
required: false required: false
default: "actions" default: "actions"
allow_other_plugins:
description: Allow other plugins to be installed. By default, we are checking if the plugins are actually prettier plugins.
required: false
default: false
runs: runs:
using: "composite" using: "composite"
@@ -97,6 +101,7 @@ runs:
INPUT_GITHUB_TOKEN: ${{ inputs.github_token }} INPUT_GITHUB_TOKEN: ${{ inputs.github_token }}
INPUT_CLEAN_NODE_FOLDER: ${{ inputs.clean_node_folder }} INPUT_CLEAN_NODE_FOLDER: ${{ inputs.clean_node_folder }}
INPUT_GIT_IDENTITY: ${{ inputs.git_identity }} INPUT_GIT_IDENTITY: ${{ inputs.git_identity }}
INPUT_ALLOW_OTHER_PLUGINS: ${{ inputs.allow_other_plugins }}
branding: branding:
icon: "award" icon: "award"

View File

@@ -49,6 +49,7 @@ npm install --silent prettier@$INPUT_PRETTIER_VERSION
# Install plugins # Install plugins
if [ -n "$INPUT_PRETTIER_PLUGINS" ]; then if [ -n "$INPUT_PRETTIER_PLUGINS" ]; then
if [ "$INPUT_ALLOW_OTHER_PLUGINS" != "true" ]; then
for plugin in $INPUT_PRETTIER_PLUGINS; do for plugin in $INPUT_PRETTIER_PLUGINS; do
echo "Checking plugin: $plugin" echo "Checking plugin: $plugin"
# check regex against @prettier/xyz # check regex against @prettier/xyz
@@ -57,6 +58,7 @@ if [ -n "$INPUT_PRETTIER_PLUGINS" ]; then
exit 1 exit 1
fi fi
done done
fi
npm install --silent $INPUT_PRETTIER_PLUGINS npm install --silent $INPUT_PRETTIER_PLUGINS
fi fi
) )