From 703597c63d9cd276f72c598bffc3f4e00d8279ca Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Sat, 23 May 2020 14:03:59 -0400 Subject: [PATCH] Fixed inputs. --- action.yml | 6 ++++++ entrypoint.sh | 7 ++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/action.yml b/action.yml index 21bc9220..bd21436f 100644 --- a/action.yml +++ b/action.yml @@ -5,6 +5,7 @@ inputs: token: description: 'GITHUB_TOKEN or a repo scoped PAT' default: ${{ github.token }} + required: true config-path: description: Eslint configuration path required: false @@ -13,6 +14,10 @@ inputs: description: Eslint ignore path required: false default: '' + extra-args: + description: Eslint extra arguments + required: false + default: '' runs: using: 'docker' image: 'Dockerfile' @@ -20,6 +25,7 @@ runs: - ${{ inputs.token }} - ${{ inputs.config-path }} - ${{ inputs.ignore-path }} + - ${{ inputs.extra-args }} branding: icon: circle color: blue diff --git a/entrypoint.sh b/entrypoint.sh index b23d666d..9cc56504 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -10,6 +10,7 @@ fi GITHUB_TOKEN=$1 CONFIG_PATH=$2 IGNORE_PATH=$3 +EXTRA_ARGS=$4 TARGET_BRANCH=${GITHUB_BASE_REF} CURRENT_BRANCH=${GITHUB_HEAD_REF} @@ -38,11 +39,11 @@ if [[ ! -z ${FILES} ]]; then echo "Skipping: No files to lint" exit 0; else - echo "Running ESLint..." + echo "Running ESLint on $CHANGED_FILES..." if [[ ! -z ${IGNORE_PATH} ]]; then - npx eslint --config=${CONFIG_PATH} --ignore-path ${IGNORE_PATH} --max-warnings=0 ${CHANGED_FILES} + npx eslint --config=${CONFIG_PATH} --ignore-path ${IGNORE_PATH} ${EXTRA_ARGS} ${CHANGED_FILES} else - npx eslint --config=${CONFIG_PATH} --max-warnings=0 ${CHANGED_FILES} + npx eslint --config=${CONFIG_PATH} ${EXTRA_ARGS} ${CHANGED_FILES} fi fi fi