Skip to content

Commit

Permalink
Merge pull request #2 from tj-actions/update-entrypoint
Browse files Browse the repository at this point in the history
Update entrypoint.sh
  • Loading branch information
Tonye Jack authored Aug 8, 2020
2 parents 9066d2c + 7ae0ee1 commit e1ef490
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
uses: ./
id: depcheck
with:
extra-args: './test-success'
dir: './test-success'
- name: Validate exit code.
if: steps.depcheck.outputs.exit_code != 0
run: |
Expand All @@ -40,7 +40,7 @@ jobs:
id: depcheck
continue-on-error: true
with:
extra-args: './test-failure'
dir: './test-failure'
- name: Validate exit code.
if: steps.depcheck.outputs.exit_code == 0
run: |
Expand Down
11 changes: 8 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,22 @@ inputs:
description: 'GITHUB_TOKEN or a Repo scoped PAT'
required: true
default: ${{ github.token }}
extra-args:
description: 'Extra arguments defaults to current directory.'
dir:
description: 'Directory to perform depcheck'
required: false
default: '.'
ignores:
description: 'Comma separated list of packages to ignore'
required: false
default: ''

runs:
using: 'docker'
image: 'Dockerfile'
args:
- ${{ inputs.token }}
- ${{ inputs.extra-args }}
- ${{ inputs.dir }}
- ${{ inputs.ignores }}
branding:
icon: check-square
color: green
5 changes: 3 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
set -o pipefail


EXTRA_ARGS=$2
DIR=$2
IGNORES=$3

OUTPUT=$(depcheck "${EXTRA_ARGS}" 2>&1) && exit_status=$? || exit_status=$?
OUTPUT=$(depcheck --ignores="${IGNORES}" "${DIR}" 2>&1) && exit_status=$? || exit_status=$?
echo "$OUTPUT"

echo "::set-output name=exit_code::$exit_status"
Expand Down

0 comments on commit e1ef490

Please sign in to comment.