mirror of
https://github.com/creyD/prettier_action.git
synced 2026-04-15 04:40:33 +02:00
Switch to composite
This commit is contained in:
18
action.yml
18
action.yml
@@ -41,8 +41,22 @@ inputs:
|
|||||||
default: ''
|
default: ''
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: 'docker'
|
using: 'composite'
|
||||||
image: 'Dockerfile'
|
steps:
|
||||||
|
- name: prettier
|
||||||
|
shell: bash
|
||||||
|
run: >-
|
||||||
|
PATH=$(cd $GITHUB_ACTION_PATH; npm bin):$PATH
|
||||||
|
INPUT_COMMIT_MESSAGE="${{ inputs.commit_message }}"
|
||||||
|
INPUT_COMMIT_OPTIONS="${{ inputs.commit_options }}"
|
||||||
|
INPUT_DRY="${{ inputs.dry }}"
|
||||||
|
INPUT_FILE_PATTERN="${{ inputs.file_pattern }}"
|
||||||
|
INPUT_ONLY_CHANGED="${{ inputs.only_changed }}"
|
||||||
|
INPUT_PRETTIER_OPTIONS="${{ inputs.prettier_options }}"
|
||||||
|
INPUT_PRETTIER_PLUGINS="${{ inputs.prettier_plugins }}"
|
||||||
|
INPUT_PRETTIER_VERSION="${{ inputs.prettier_version }}"
|
||||||
|
INPUT_SAME_COMMIT="${{ inputs.same_commit }}"
|
||||||
|
$GITHUB_ACTION_PATH/entrypoint.sh
|
||||||
|
|
||||||
branding:
|
branding:
|
||||||
icon: 'award'
|
icon: 'award'
|
||||||
|
|||||||
@@ -25,14 +25,22 @@ _git_changed() {
|
|||||||
[[ -n "$(git status -s)" ]]
|
[[ -n "$(git status -s)" ]]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
(
|
||||||
|
if [ -n "$GITHUB_ACTION_PATH" ]; then
|
||||||
|
cd $GITHUB_ACTION_PATH
|
||||||
|
maybe_global=''
|
||||||
|
else
|
||||||
|
maybe_global=--global
|
||||||
|
fi
|
||||||
|
|
||||||
# PROGRAM
|
# PROGRAM
|
||||||
echo "Installing prettier..."
|
echo "Installing prettier..."
|
||||||
case $INPUT_PRETTIER_VERSION in
|
case $INPUT_PRETTIER_VERSION in
|
||||||
false)
|
false)
|
||||||
npm install --silent --global prettier
|
npm install --silent $maybe_global prettier
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
npm install --silent --global prettier@$INPUT_PRETTIER_VERSION
|
npm install --silent $maybe_global prettier@$INPUT_PRETTIER_VERSION
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
@@ -46,8 +54,9 @@ if [ -n "$INPUT_PRETTIER_PLUGINS" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
npm install --silent --global $INPUT_PRETTIER_PLUGINS
|
npm install --silent $maybe_global $INPUT_PRETTIER_PLUGINS
|
||||||
fi
|
fi
|
||||||
|
)
|
||||||
|
|
||||||
echo "Prettifing files..."
|
echo "Prettifing files..."
|
||||||
echo "Files:"
|
echo "Files:"
|
||||||
|
|||||||
Reference in New Issue
Block a user