Skip to content

Commit

Permalink
Fixed inputs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tonye Jack committed May 23, 2020
1 parent 7a84546 commit 703597c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 6 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -13,13 +14,18 @@ inputs:
description: Eslint ignore path
required: false
default: ''
extra-args:
description: Eslint extra arguments
required: false
default: ''
runs:
using: 'docker'
image: 'Dockerfile'
args:
- ${{ inputs.token }}
- ${{ inputs.config-path }}
- ${{ inputs.ignore-path }}
- ${{ inputs.extra-args }}
branding:
icon: circle
color: blue
7 changes: 4 additions & 3 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand Down Expand Up @@ -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

0 comments on commit 703597c

Please sign in to comment.