Skip to content

Commit

Permalink
Merge pull request #6 from tj-actions/feature/add-support-for-specify…
Browse files Browse the repository at this point in the history
…ing-depcheck-version
  • Loading branch information
Tonye Jack authored Dec 5, 2020
2 parents 104d6ab + f35de93 commit 867826a
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 4 deletions.
39 changes: 37 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,49 @@ on:
- master

jobs:
test-success:
shellcheck:
runs-on: ubuntu-latest
name: Test success depcheck
name: Run Shellcheck
steps:
- name: Checkout
uses: actions/checkout@v2
- name: shellcheck
uses: reviewdog/action-shellcheck@v1
test-versions:
runs-on: ubuntu-latest
name: Test installing versions
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Default version
uses: ./
id: depcheck-default
with:
dir: './test-success'
- name: Version 1-3-0
uses: ./
id: depcheck-1-3-0
with:
dir: './test-success'
version: '1.3.0'
- name: Version 1-2-0
uses: ./
id: depcheck-1-2-0
with:
dir: './test-success'
version: '1.2.0'
- name: Version 1-0-0
uses: ./
id: depcheck-1-0-0
with:
dir: './test-success'
version: '1.0.0'
test-success:
runs-on: ubuntu-latest
name: Test success depcheck
steps:
- name: Checkout
uses: actions/checkout@v2
- name: depcheck
uses: ./
id: depcheck
Expand Down
2 changes: 0 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ LABEL maintainer="Tonye Jack <jtonye@ymail.com>"

RUN apk add bash curl

RUN yarn global add depcheck

COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ inputs:
description: 'Comma separated list of packages to ignore'
required: false
default: ''
version:
description: 'Provide a version for depcheck'
required: false
default: '1.3.1'

runs:
using: 'docker'
Expand Down
1 change: 1 addition & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

set -o pipefail

yarn global add depcheck@"${INPUT_VERSION}"

OUTPUT=$(depcheck --ignores="${INPUT_IGNORES}" "${INPUT_DIR}" 2>&1) && exit_status=$? || exit_status=$?
echo "$OUTPUT"
Expand Down

0 comments on commit 867826a

Please sign in to comment.