diff --git a/.github/workflows/dockerless.yml b/.github/workflows/dockerless.yml new file mode 100644 index 0000000..293e2d4 --- /dev/null +++ b/.github/workflows/dockerless.yml @@ -0,0 +1,87 @@ +name: reviewdog +on: [pull_request] + +permissions: + contents: read + checks: write + pull-requests: write + issues: write + +jobs: + actionlint: + name: runner / actionlint + runs-on: ubuntu-latest + steps: + - name: Harden the runner (Audit all outbound calls) + uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0 + with: + egress-policy: audit + + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: actionlint + uses: ./dockerless/ + with: + tool_name: dockerless actionlint + + reviewdog: + name: runner / reviewdog + strategy: + fail-fast: false + matrix: + os: ${{ github.actor == 'dependabot[bot]' && fromJSON('["ubuntu-26.04"]') || fromJSON('["ubuntu-slim", "ubuntu-26.04", "ubuntu-26.04-arm", "macos-latest", "windows-latest", "windows-11-arm"]') }} + runs-on: ${{ matrix.os }} + steps: + - name: Harden the runner (Audit all outbound calls) + uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0 + with: + egress-policy: audit + + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: actionlint w/ reviewdog + uses: ./dockerless/ + with: + actionlint_flags: examples/broken-workflow.yml + tool_name: dockerless reviewdog on ${{ matrix.os }} + level: info + + shellcheck: + name: runner / shellcheck + strategy: + fail-fast: false + matrix: + os: ${{ github.actor == 'dependabot[bot]' && fromJSON('["ubuntu-26.04"]') || fromJSON('["ubuntu-slim", "ubuntu-26.04", "ubuntu-26.04-arm", "macos-latest", "windows-latest", "windows-11-arm"]') }} + runs-on: ${{ matrix.os }} + steps: + - name: Harden the runner (Audit all outbound calls) + uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0 + with: + egress-policy: audit + + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: actionlint w/ shellcheck + uses: ./dockerless/ + with: + actionlint_flags: examples/shellcheck.yml + tool_name: dockerless shellcheck on ${{ matrix.os }} + level: info + + pyflakes: + name: runner / pyflakes + strategy: + fail-fast: false + matrix: + os: ${{ github.actor == 'dependabot[bot]' && fromJSON('["ubuntu-26.04"]') || fromJSON('["ubuntu-slim", "ubuntu-26.04", "ubuntu-26.04-arm", "macos-latest", "windows-latest", "windows-11-arm"]') }} + runs-on: ${{ matrix.os }} + steps: + - name: Harden the runner (Audit all outbound calls) + uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0 + with: + egress-policy: audit + + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: actionlint w/ pyflakes + uses: ./dockerless/ + with: + actionlint_flags: examples/pyflakes.yml + tool_name: dockerless pyflakes on ${{ matrix.os }} + level: info diff --git a/.github/workflows/reviewdog.yml b/.github/workflows/reviewdog.yml index 9248023..2fd7027 100644 --- a/.github/workflows/reviewdog.yml +++ b/.github/workflows/reviewdog.yml @@ -17,7 +17,7 @@ jobs: with: egress-policy: audit - - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: actionlint uses: ./ with: @@ -25,48 +25,63 @@ jobs: reviewdog: name: runner / reviewdog - runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + os: ${{ github.actor == 'dependabot[bot]' && fromJSON('["ubuntu-26.04"]') || fromJSON('["ubuntu-26.04", "ubuntu-26.04-arm"]') }} + runs-on: ${{ matrix.os }} steps: - name: Harden the runner (Audit all outbound calls) uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0 with: egress-policy: audit - - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: actionlint w/ reviewdog uses: ./ with: actionlint_flags: examples/broken-workflow.yml - tool_name: reviewdog + tool_name: reviewdog on ${{ matrix.os }} + level: info shellcheck: name: runner / shellcheck - runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + os: ${{ github.actor == 'dependabot[bot]' && fromJSON('["ubuntu-26.04"]') || fromJSON('["ubuntu-26.04", "ubuntu-26.04-arm"]') }} + runs-on: ${{ matrix.os }} steps: - name: Harden the runner (Audit all outbound calls) uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0 with: egress-policy: audit - - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: actionlint w/ shellcheck uses: ./ with: actionlint_flags: examples/shellcheck.yml - tool_name: shellcheck + tool_name: shellcheck on ${{ matrix.os }} + level: info pyflakes: name: runner / pyflakes - runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + os: ${{ github.actor == 'dependabot[bot]' && fromJSON('["ubuntu-26.04"]') || fromJSON('["ubuntu-26.04", "ubuntu-26.04-arm"]') }} + runs-on: ${{ matrix.os }} steps: - name: Harden the runner (Audit all outbound calls) uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0 with: egress-policy: audit - - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: actionlint w/ pyflakes uses: ./ with: actionlint_flags: examples/pyflakes.yml - tool_name: pyflakes + tool_name: pyflakes on ${{ matrix.os }} + level: info diff --git a/Dockerfile b/Dockerfile index 4bd92fa..40b5397 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,51 +1,21 @@ -# Single base image as requested -FROM golang:1.25-alpine3.23@sha256:f6751d823c26342f9506c03797d2527668d095b0a15f1862cddb4d927a7a4ced - -# Versions -ENV SHELLCHECK_VERSION=v0.11.0 \ - REVIEWDOG_VERSION=v0.21.0 \ - ACTIONLINT_VERSION=v1.7.12 - -# System deps: build tools, git, curl, wget, xz for .tar.xz, python & pip -RUN set -eux; \ - apk add --no-cache \ - git curl wget xz \ - build-base \ - python3 py3-pyflakes \ - jq - -# Install ShellCheck (prebuilt tarball matching arch) -RUN set -eux; \ - arch="$(uname -m)"; \ - echo "arch is ${arch}"; \ - if [ "${arch}" = "armv7l" ]; then arch='armv6hf'; fi; \ - url_base='https://github.com/koalaman/shellcheck/releases/download'; \ - tar_file="${SHELLCHECK_VERSION}/shellcheck-${SHELLCHECK_VERSION}.linux.${arch}.tar.xz"; \ - wget -q "${url_base}/${tar_file}" -O - | tar xJf -; \ - mv "shellcheck-${SHELLCHECK_VERSION}/shellcheck" /usr/local/bin/; \ - rm -rf "shellcheck-${SHELLCHECK_VERSION}"; \ - /usr/local/bin/shellcheck --version - -# Build reviewdog from exact tag -RUN set -eux; \ - git clone --depth 1 --branch "${REVIEWDOG_VERSION}" https://github.com/reviewdog/reviewdog.git /tmp/reviewdog; \ - cd /tmp/reviewdog; \ - go mod edit -require=golang.org/x/crypto@v0.45.0; \ - go mod edit -require=golang.org/x/oauth2@v0.27.0 || true; \ - go mod tidy; \ - go build -trimpath -ldflags "-s -w" -o /usr/local/bin/reviewdog ./cmd/reviewdog; \ - /usr/local/bin/reviewdog -version || true; \ - rm -rf /tmp/reviewdog - -# Build actionlint from exact tag -RUN set -eux; \ - git clone --depth 1 --branch "${ACTIONLINT_VERSION}" https://github.com/rhysd/actionlint.git /tmp/actionlint; \ - cd /tmp/actionlint; \ - go build -trimpath -ldflags "-s -w" -o /usr/local/bin/actionlint ./cmd/actionlint; \ - /usr/local/bin/actionlint --version; \ - rm -rf /tmp/actionlint - -# Add entrypoint +FROM python:3.14.7-alpine3.24@sha256:f2186fc449b8f7aa5897b542777427a21dc77864f271cf4d1646361cf681c2b9 + +RUN apk --no-cache add git curl bash + +COPY scripts scripts + +# install pyflakes +RUN ./scripts/install-pyflakes.sh + +# install shellcheck +RUN ./scripts/install-shellcheck.sh + +# install actionlint +RUN OSTYPE=linux-gnu ./scripts/install-actionlint.sh + +# install reviewdog +RUN ./scripts/install-reviewdog.sh + COPY entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh diff --git a/README.md b/README.md index 84ef9be..dc60632 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,8 @@ code review experience. ## Example usages +### Docker-based (default) + ```yaml name: reviewdog on: [pull_request] @@ -22,10 +24,28 @@ jobs: actionlint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - uses: step-security/action-actionlint@v1 ``` +### Dockerless + +If you prefer to run without Docker, a dockerless version is also available: + +```yaml +name: reviewdog +on: [pull_request] +jobs: + actionlint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - uses: step-security/action-actionlint/dockerless@v1 +``` + +The dockerless version directly installs actionlint and reviewdog on the runner without using Docker. +This can be useful in environments where Docker is not available. + ## Inputs ### `github_token` diff --git a/action.yml b/action.yml index ed5bfbf..670615e 100644 --- a/action.yml +++ b/action.yml @@ -1,57 +1,57 @@ -name: 'actionlint with reviewdog' -description: 'run actionlint with reviewdog' -author: 'step-security' +name: "actionlint with reviewdog" +description: "run actionlint with reviewdog" +author: "step-security" inputs: github_token: - description: 'GITHUB_TOKEN.' - default: '${{ github.token }}' + description: "GITHUB_TOKEN." + default: "${{ github.token }}" required: true tool_name: - description: 'Tool name to use for reviewdog reporter' - default: 'actionlint' + description: "Tool name to use for reviewdog reporter" + default: "actionlint" required: true level: - description: 'Report level for reviewdog [info,warning,error]' - default: 'error' + description: "Report level for reviewdog [info,warning,error]" + default: "error" required: true reporter: description: | Reporter of reviewdog command [github-pr-check,github-pr-review,github-check]. Default is github-pr-check. github-pr-review can use Markdown and add a link to rule page in reviewdog reports. - default: 'github-pr-check' + default: "github-pr-check" required: true filter_mode: description: | Filtering mode for the reviewdog command [added,diff_context,file,nofilter]. Default is file. - default: 'file' + default: "file" required: true fail_level: description: | If set to `none`, always use exit code 0 for reviewdog. Otherwise, exit code 1 for reviewdog if it finds at least 1 issue with severity greater than or equal to the given level. Possible values: [none,any,info,warning,error] Default is `none`. - default: 'none' + default: "none" fail_on_error: description: | Deprecated, use `fail_level` instead. Exit code for reviewdog when errors are found [true,false] Default is `false`. deprecationMessage: Deprecated, use `fail_level` instead. - default: 'false' + default: "false" required: true reviewdog_flags: - description: 'Additional reviewdog flags' - default: '' + description: "Additional reviewdog flags" + default: "" required: false actionlint_flags: - description: 'Additional actionlint flags' - default: '' + description: "Additional actionlint flags" + default: "" required: false runs: - using: 'docker' - image: 'docker://ghcr.io/step-security/action-actionlint:v1.72.0@sha256:7f6f21f88720f33a61bc714ee7dc6243defcb2f2ae0697bb582e6769825612ae' #v1.72.0 + using: "docker" + image: "docker://ghcr.io/step-security/action-actionlint:v1.72.0@sha256:7f6f21f88720f33a61bc714ee7dc6243defcb2f2ae0697bb582e6769825612ae" #v1.72.0 entrypoint: /entrypoint.sh branding: color: red diff --git a/dockerless/action.yml b/dockerless/action.yml new file mode 100644 index 0000000..c9e097f --- /dev/null +++ b/dockerless/action.yml @@ -0,0 +1,133 @@ +name: "actionlint with reviewdog (dockerless)" +description: "run actionlint with reviewdog." +author: "step-security" +inputs: + github_token: + description: "GITHUB_TOKEN." + default: "${{ github.token }}" + required: true + tool_name: + description: "Tool name to use for reviewdog reporter" + default: "actionlint" + required: true + level: + description: "Report level for reviewdog [info,warning,error]" + default: "error" + required: true + reporter: + description: | + Reporter of reviewdog command [github-pr-check,github-pr-review,github-check]. + Default is github-pr-check. + github-pr-review can use Markdown and add a link to rule page in reviewdog reports. + default: "github-pr-check" + required: true + filter_mode: + description: | + Filtering mode for the reviewdog command [added,diff_context,file,nofilter]. + Default is file. + default: "file" + required: true + fail_level: + description: | + If set to `none`, always use exit code 0 for reviewdog. Otherwise, exit code 1 for reviewdog if it finds at least 1 issue with severity greater than or equal to the given level. + Possible values: [none,any,info,warning,error] + Default is `none`. + default: "none" + fail_on_error: + description: | + Deprecated, use `fail_level` instead. + Exit code for reviewdog when errors are found [true,false] + Default is `false`. + deprecationMessage: Deprecated, use `fail_level` instead. + default: "false" + required: true + reviewdog_flags: + description: "Additional reviewdog flags" + default: "" + required: false + actionlint_flags: + description: "Additional actionlint flags" + default: "" + required: false +runs: + using: "composite" + steps: + - name: Subscription check + env: + REPO_PRIVATE: ${{ github.event.repository.private }} + shell: bash + run: | + UPSTREAM="reviewdog/action-actionlint" + ACTION_REPO="${GITHUB_ACTION_REPOSITORY:-}" + DOCS_URL="https://docs.stepsecurity.io/actions/stepsecurity-maintained-actions" + + echo "" + echo -e "\033[1;36mStepSecurity Maintained Action\033[0m" + echo "Secure drop-in replacement for $UPSTREAM" + if [ "$REPO_PRIVATE" = "false" ]; then + echo -e "\033[32m✓ Free for public repositories\033[0m" + fi + echo -e "\033[36mLearn more:\033[0m $DOCS_URL" + echo "" + + if [ "$REPO_PRIVATE" != "false" ]; then + SERVER_URL="${GITHUB_SERVER_URL:-https://github.com}" + + if [ "$SERVER_URL" != "https://github.com" ]; then + BODY=$(printf '{"action":"%s","ghes_server":"%s"}' "$ACTION_REPO" "$SERVER_URL") + else + BODY=$(printf '{"action":"%s"}' "$ACTION_REPO") + fi + + API_URL="https://agent.api.stepsecurity.io/v1/github/$GITHUB_REPOSITORY/actions/maintained-actions-subscription" + + RESPONSE=$(curl --max-time 3 -s -w "%{http_code}" \ + -X POST \ + -H "Content-Type: application/json" \ + -d "$BODY" \ + "$API_URL" -o /dev/null) && CURL_EXIT_CODE=0 || CURL_EXIT_CODE=$? + + if [ $CURL_EXIT_CODE -ne 0 ]; then + echo "Timeout or API not reachable. Continuing to next step." + elif [ "$RESPONSE" = "403" ]; then + echo -e "::error::\033[1;31mThis action requires a StepSecurity subscription for private repositories.\033[0m" + echo -e "::error::\033[31mLearn how to enable a subscription: $DOCS_URL\033[0m" + exit 1 + fi + fi + + - name: install pyflakes + shell: bash + run: | + "$GITHUB_ACTION_PATH/../scripts/install-pyflakes.sh" + - name: install shellcheck + shell: bash + run: | + "$GITHUB_ACTION_PATH/../scripts/install-shellcheck.sh" + - name: install actionlint + shell: bash + run: | + "$GITHUB_ACTION_PATH/../scripts/install-actionlint.sh" + - name: install reviewdog + shell: bash + run: | + "$GITHUB_ACTION_PATH/../scripts/install-reviewdog.sh" + + - name: Run + env: + ACTION_PATH: ${{ github.action_path }} + INPUT_GITHUB_TOKEN: ${{ inputs.github_token }} + INPUT_TOOL_NAME: ${{ inputs.tool_name }} + INPUT_LEVEL: ${{ inputs.level }} + INPUT_REPORTER: ${{ inputs.reporter }} + INPUT_FILTER_MODE: ${{ inputs.filter_mode }} + INPUT_FAIL_LEVEL: ${{ inputs.fail_level }} + INPUT_FAIL_ON_ERROR: ${{ inputs.fail_on_error }} + INPUT_REVIEWDOG_FLAGS: ${{ inputs.reviewdog_flags }} + INPUT_ACTIONLINT_FLAGS: ${{ inputs.actionlint_flags }} + shell: bash + run: $ACTION_PATH/../entrypoint.sh + +branding: + color: red + icon: check-circle diff --git a/entrypoint.sh b/entrypoint.sh index c01869b..6668285 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,5 +1,7 @@ #!/bin/sh +set -eu + REPO_PRIVATE=$(jq -r '.repository.private | tostring' "$GITHUB_EVENT_PATH" 2>/dev/null || echo "") UPSTREAM="reviewdog/action-actionlint" ACTION_REPO="${GITHUB_ACTION_REPOSITORY:-}" @@ -39,7 +41,7 @@ if [ "$REPO_PRIVATE" != "false" ]; then exit 1 fi fi -if [ "${RUNNER_DEBUG}" = "1" ] ; then +if [ "${RUNNER_DEBUG:-}" = "1" ] ; then set -x fi @@ -48,6 +50,23 @@ if [ -n "${GITHUB_WORKSPACE}" ] ; then git config --global --add safe.directory "${GITHUB_WORKSPACE}" || exit 1 fi +# show versions of tools +echo "::group:: pyflakes version" +pyflakes --version +echo "::endgroup::" + +echo "::group:: shellcheck version" +shellcheck --version +echo "::endgroup::" + +echo "::group:: actionlint version" +actionlint --version +echo "::endgroup::" + +echo "::group:: reviewdog version" +reviewdog --version +echo "::endgroup::" + export REVIEWDOG_GITHUB_API_TOKEN="${INPUT_GITHUB_TOKEN}" # shellcheck disable=SC2086 diff --git a/examples/broken-workflow.yml b/examples/broken-workflow.yml index 5c7b88e..f6628c6 100644 --- a/examples/broken-workflow.yml +++ b/examples/broken-workflow.yml @@ -12,8 +12,8 @@ jobs: os: [macos-latest, linux-latest] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 - - uses: actions/cache@v2 + - uses: actions/checkout@v7 + - uses: actions/cache@v6 with: path: ~/.npm key: ${{ matrix.platform }}-node-${{ hashFiles('**/package-lock.json') }} diff --git a/scripts/install-actionlint.sh b/scripts/install-actionlint.sh new file mode 100755 index 0000000..3b05b71 --- /dev/null +++ b/scripts/install-actionlint.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +set -euo pipefail +if [ -n "${RUNNER_DEBUG:-}" ] ; then + set -x +fi + +ACTIONLINT_VERSION=1.7.12 + +if [ "${GITHUB_ACTIONS:-}" = "true" ]; then + INSTALL_DIR=$(mktemp -d) + echo "$INSTALL_DIR" >> "$GITHUB_PATH" +else + INSTALL_DIR=/usr/local/bin/ +fi + +cd "$INSTALL_DIR" +curl -sSL https://raw.githubusercontent.com/rhysd/actionlint/914e7df21a07ef503a81201c76d2b11c789d3fca/scripts/download-actionlint.bash | bash -s -- "$ACTIONLINT_VERSION" diff --git a/scripts/install-pyflakes.sh b/scripts/install-pyflakes.sh new file mode 100755 index 0000000..b37435b --- /dev/null +++ b/scripts/install-pyflakes.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -euo pipefail +if [ -n "${RUNNER_DEBUG:-}" ] ; then + set -x +fi + +cd "$(dirname "$0")" + +OS_NAME="$(uname -s | tr '[:upper:]' '[:lower:]')" +if [ "${OS_NAME}" = "darwin" ]; then + pipx install "$(cat ./requirements.txt)" +else + python3 -m pip install --no-cache-dir --upgrade pip + python3 -m pip install --no-cache-dir -r ./requirements.txt +fi diff --git a/scripts/install-reviewdog.sh b/scripts/install-reviewdog.sh new file mode 100755 index 0000000..39f628a --- /dev/null +++ b/scripts/install-reviewdog.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +set -euo pipefail +if [ -n "${RUNNER_DEBUG:-}" ] ; then + set -x +fi + +REVIEWDOG_VERSION=0.21.0 + +if [ "${GITHUB_ACTIONS:-}" = "true" ]; then + INSTALL_DIR=$(mktemp -d) + echo "$INSTALL_DIR" >> "$GITHUB_PATH" +else + INSTALL_DIR=/usr/local/bin/ +fi + +curl -sSL https://raw.githubusercontent.com/reviewdog/reviewdog/df70ed74df59de7ebfd9276afabd62ea2de4d7dd/install.sh | sh -s -- -b "$INSTALL_DIR" "v$REVIEWDOG_VERSION" diff --git a/scripts/install-shellcheck.sh b/scripts/install-shellcheck.sh new file mode 100755 index 0000000..8cbd5cf --- /dev/null +++ b/scripts/install-shellcheck.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +set -euo pipefail +if [ -n "${RUNNER_DEBUG:-}" ] ; then + set -x +fi + +SHELLCHECK_VERSION=0.11.0 +OS_NAME=$(uname -s | tr '[:upper:]' '[:lower:]') +ARCH=$(uname -m) +if [ "${ARCH}" = "arm64" ] || [ "${ARCH}" = "aarch64" ]; then + CPU_ARCH="aarch64" +else + CPU_ARCH="x86_64" +fi + +if [ "${GITHUB_ACTIONS:-}" = "true" ]; then + INSTALL_DIR=$(mktemp -d) + echo "$INSTALL_DIR" >> "$GITHUB_PATH" +else + INSTALL_DIR=/usr/local/bin/ +fi + +case "${OS_NAME}" in + linux) + curl -sSL "https://github.com/koalaman/shellcheck/releases/download/v${SHELLCHECK_VERSION}/shellcheck-v${SHELLCHECK_VERSION}.linux.${CPU_ARCH}.tar.xz" | tar -xJf - --strip-components=1 -C "${INSTALL_DIR}" "shellcheck-v${SHELLCHECK_VERSION}/shellcheck" + ;; + darwin) + curl -sSL "https://github.com/koalaman/shellcheck/releases/download/v${SHELLCHECK_VERSION}/shellcheck-v${SHELLCHECK_VERSION}.darwin.${CPU_ARCH}.tar.xz" | tar -xJf - --strip-components=1 -C "${INSTALL_DIR}" "shellcheck-v${SHELLCHECK_VERSION}/shellcheck" + ;; + *) # windows + curl -sSL "https://github.com/koalaman/shellcheck/releases/download/v${SHELLCHECK_VERSION}/shellcheck-v${SHELLCHECK_VERSION}.zip" -o shellcheck.zip + unzip shellcheck.zip -d "${INSTALL_DIR}" + rm shellcheck.zip + ;; +esac diff --git a/scripts/requirements.txt b/scripts/requirements.txt new file mode 100644 index 0000000..3028467 --- /dev/null +++ b/scripts/requirements.txt @@ -0,0 +1 @@ +pyflakes==3.4.0