From 4ffed7baf7c1af44a28bc8bc9d952c3efee6c80e Mon Sep 17 00:00:00 2001 From: haya14busa Date: Sat, 6 Sep 2025 14:40:45 +0900 Subject: [PATCH] use reviewdog/action-setup instead of syncing scripts Using nested GitHub Actions was not the root cause of https://github.com/reviewdog/action-suggester/issues/35 in my understanding. --- .github/depup.sh | 19 ------------------- .github/workflows/depup.yml | 8 -------- action.yml | 14 +++----------- check-installed.sh | 9 --------- install.sh | 37 ------------------------------------- 5 files changed, 3 insertions(+), 84 deletions(-) delete mode 100755 .github/depup.sh delete mode 100755 check-installed.sh delete mode 100755 install.sh diff --git a/.github/depup.sh b/.github/depup.sh deleted file mode 100755 index 18f84df..0000000 --- a/.github/depup.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -CURRENT=$(cd "$(dirname "$0")" && pwd) - -set -eu - -# cleanup temporary directory -unset tmpdir -atexit() { - [[ -n ${tmpdir-} ]] && rm -rf "$tmpdir" -} -trap atexit EXIT -trap 'rc=$?; trap - EXIT; atexit; exit $?' INT PIPE TERM - -tmpdir=$(mktemp -d) - -# sync install.sh with https://github.com/reviewdog/action-setup -curl -sSL https://raw.githubusercontent.com/reviewdog/action-setup/master/install.sh -o "$tmpdir/install.sh" -install -m 755 "$tmpdir/install.sh" "$CURRENT/../install.sh" diff --git a/.github/workflows/depup.yml b/.github/workflows/depup.yml index ece1072..447bf7e 100644 --- a/.github/workflows/depup.yml +++ b/.github/workflows/depup.yml @@ -17,11 +17,3 @@ jobs: version_name: REVIEWDOG_VERSION repo: reviewdog/reviewdog labels: "bump:minor" - - setup: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - - run: ./.github/depup.sh - - name: commit and create a pull request - uses: shogo82148/actions-commit-and-create-pr@b1322fe9da4037e9720e34ea221997cffcd3498d # v1.1.4 diff --git a/action.yml b/action.yml index c5c146b..289115d 100644 --- a/action.yml +++ b/action.yml @@ -51,17 +51,9 @@ inputs: runs: using: "composite" steps: - - run: | - set -euo pipefail - . "$GITHUB_ACTION_PATH/install.sh" - shell: bash - env: - REVIEWDOG_VERSION: v0.21.0 - REVIEWDOG_TEMPDIR: ${{ runner.temp }} - - run: | - set -euo pipefail - . "$GITHUB_ACTION_PATH/check-installed.sh" - shell: bash + - uses: reviewdog/action-setup@d8edfce3dd5e1ec6978745e801f9c50b5ef80252 # v1.4.0 + with: + reviewdog_version: v0.21.0 - run: | set -euo pipefail . "$GITHUB_ACTION_PATH/script.sh" diff --git a/check-installed.sh b/check-installed.sh deleted file mode 100755 index fe649fc..0000000 --- a/check-installed.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -if ! command -v reviewdog >/dev/null 2>&1; then - echo "reviewdog was not installed" - exit 1 -fi -echo "::group::📖 reviewdog -h" -reviewdog -h 2>&1 || true -echo "::endgroup::" diff --git a/install.sh b/install.sh deleted file mode 100755 index 4d0cbd3..0000000 --- a/install.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh - -set -eu - -VERSION="${REVIEWDOG_VERSION:-latest}" - -TEMP="${REVIEWDOG_TEMPDIR}" -if [ -z "${TEMP}" ]; then - if [ -n "${RUNNER_TEMP}" ]; then - TEMP="${RUNNER_TEMP}" - else - TEMP="$(mktemp -d)" - fi -fi - -INSTALL_SCRIPT='https://raw.githubusercontent.com/reviewdog/reviewdog/df70ed74df59de7ebfd9276afabd62ea2de4d7dd/install.sh' -if [ "${VERSION}" = 'nightly' ]; then - INSTALL_SCRIPT='https://raw.githubusercontent.com/reviewdog/nightly/a41f181a20068bf2c0499054e4c19bdebc71b362/install.sh' - VERSION='latest' -fi - -mkdir -p "${TEMP}/reviewdog/bin" - -echo '::group::🐶 Installing reviewdog ... https://github.com/reviewdog/reviewdog' -( - if command -v curl 2>&1 >/dev/null; then - curl -sfL "${INSTALL_SCRIPT}" - elif command -v wget 2>&1 >/dev/null; then - wget -O - "${INSTALL_SCRIPT}" - else - echo "curl or wget is required" >&2 - exit 1 - fi -) | sh -s -- -b "${TEMP}/reviewdog/bin" "${VERSION}" 2>&1 -echo '::endgroup::' - -echo "${TEMP}/reviewdog/bin" >>"${GITHUB_PATH}"