diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 407facd..c3efc97 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 diff --git a/Dockerfile b/Dockerfile index a78240c..a707a24 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,8 +7,6 @@ LABEL maintainer="Tonye Jack " RUN apk add bash curl -RUN yarn global add depcheck - COPY entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] diff --git a/action.yml b/action.yml index ffa69f6..a9af358 100644 --- a/action.yml +++ b/action.yml @@ -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' diff --git a/entrypoint.sh b/entrypoint.sh index c94dc5d..da354e4 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -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"