From 5812ee9d3515b17aca5d3569a6982241b6a3a81b Mon Sep 17 00:00:00 2001 From: Songmu Date: Sun, 9 Feb 2025 22:18:05 +0900 Subject: [PATCH 1/6] support Bun --- script.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/script.sh b/script.sh index 42dc587..5512849 100755 --- a/script.sh +++ b/script.sh @@ -11,6 +11,8 @@ echo '::group::🐶 Installing reviewdog ... https://github.com/reviewdog/review curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s -- -b "${TEMP_PATH}" "${REVIEWDOG_VERSION}" 2>&1 echo '::endgroup::' +PACKAGE_EXECUTER=npx + echo '::group:: Installing textlint ... https://github.com/textlint/textlint' if [ -x "./node_modules/.bin/textlint" ]; then echo 'already installed' @@ -23,6 +25,10 @@ elif [[ "${INPUT_PACKAGE_MANAGER}" == "yarn" ]]; then elif [[ "${INPUT_PACKAGE_MANAGER}" == "pnpm" ]]; then echo 'pnpm install start' pnpm install +elif [[ "${INPUT_PACKAGE_MANAGER}" == "bun" ]]; then + echo 'bun install start' + bun install + PACKAGE_EXECUTER=bunx else echo 'The specified package manager is not supported.' echo '::endgroup::' @@ -30,7 +36,7 @@ else fi if [ -x "./node_modules/.bin/textlint" ]; then - npx textlint --version + $PACKAGE_EXECUTER textlint --version else echo 'This repository was not configured for textlint, process done.' exit 1 @@ -47,7 +53,7 @@ reviewdog_exit_val="0" reviewdog_exit_val2="0" # shellcheck disable=SC2086 -textlint_check_output=$(npx textlint -f checkstyle ${INPUT_TEXTLINT_FLAGS} 2>&1) \ +textlint_check_output=$(${PACKAGE_EXECUTER} textlint -f checkstyle ${INPUT_TEXTLINT_FLAGS} 2>&1) \ || textlint_exit_val="$?" # shellcheck disable=SC2086 @@ -64,7 +70,7 @@ echo '::endgroup::' if [[ "${INPUT_REPORTER}" == "github-pr-review" ]]; then echo '::group:: Running textlint fixing report 🐶 ...' # fix - npx textlint --fix ${INPUT_TEXTLINT_FLAGS:-.} || true + $PACKAGE_EXECUTER textlint --fix ${INPUT_TEXTLINT_FLAGS:-.} || true TMPFILE=$(mktemp) git diff > "${TMPFILE}" From b37cf390abe71f867f8da9a4e0163e0696402710 Mon Sep 17 00:00:00 2001 From: Songmu Date: Mon, 10 Feb 2025 10:57:41 +0900 Subject: [PATCH 2/6] support Bun --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 43cf30f..e186113 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ textlint arguments (i.e. target dir:`doc/*`) ### `package_manager` -Optional. Package manager used in the repository [npm,yarn,pnpm] +Optional. Package manager used in the repository [npm,yarn,pnpm,bun] Default is `npm`. ## Customizes From 2ae5ade6842c28fb111d548245d51120d14b145b Mon Sep 17 00:00:00 2001 From: Tsuyoshi CHO Date: Mon, 10 Feb 2025 22:55:17 +0900 Subject: [PATCH 3/6] test: Add bun test --- .github/workflows/test.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ff39d5a..18e35a1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -90,6 +90,31 @@ jobs: reporter: github-pr-check textlint_flags: "doc/**" + test-pr-check-bun: + if: github.event_name == 'pull_request' + name: runner / textlint (github-pr-check) + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: true + - name: Setup node + uses: actions/setup-node@v1 + with: + node-version: 20 + - name: Setup bun + uses: oven-sh/setup-bun@v2 + with: + bun-version: latest + - name: textlint-github-check + uses: ./ + with: + github_token: ${{ secrets.github_token }} + package_manager: pnpm + reporter: github-pr-check + textlint_flags: "doc/**" + test-pr-review: if: github.event_name == 'pull_request' name: runner / textlint (github-pr-review) From d705160f5c5aa0bcfe34835e2845cf97ec728ab5 Mon Sep 17 00:00:00 2001 From: Tsuyoshi CHO Date: Mon, 10 Feb 2025 22:57:34 +0900 Subject: [PATCH 4/6] fixup! test: Add bun test --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 18e35a1..732b1bd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -111,7 +111,7 @@ jobs: uses: ./ with: github_token: ${{ secrets.github_token }} - package_manager: pnpm + package_manager: bun reporter: github-pr-check textlint_flags: "doc/**" From c6a4845f6cb2383e545a8e08ec10219ea4aee3f8 Mon Sep 17 00:00:00 2001 From: Tsuyoshi CHO Date: Mon, 10 Feb 2025 23:06:08 +0900 Subject: [PATCH 5/6] ci: action comment update --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index ec23ce5..6e3c012 100644 --- a/action.yml +++ b/action.yml @@ -36,7 +36,7 @@ inputs: description: 'Tool name to use for reviewdog reporter' default: 'textlint' package_manager: - description: 'Package manager used in the repository' + description: 'Package manager used in the repository [npm,yarn,pnpm,bun]' default: 'npm' runs: using: 'composite' From d69878544af71bdc4464762e9c2abe73fe73be75 Mon Sep 17 00:00:00 2001 From: Tsuyoshi CHO Date: Mon, 10 Feb 2025 23:09:03 +0900 Subject: [PATCH 6/6] chore: Update ci name --- .github/workflows/test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 732b1bd..f2796d8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,7 +25,7 @@ jobs: test-pr-check-npm: if: github.event_name == 'pull_request' - name: runner / textlint (github-pr-check) + name: runner / textlint (github-pr-check, npm) runs-on: ubuntu-latest steps: - name: Checkout @@ -46,7 +46,7 @@ jobs: test-pr-check-yarn: if: github.event_name == 'pull_request' - name: runner / textlint (github-pr-check) + name: runner / textlint (github-pr-check, yarn) runs-on: ubuntu-latest steps: - name: Checkout @@ -67,7 +67,7 @@ jobs: test-pr-check-pnpm: if: github.event_name == 'pull_request' - name: runner / textlint (github-pr-check) + name: runner / textlint (github-pr-check, pnpm) runs-on: ubuntu-latest steps: - name: Checkout @@ -92,7 +92,7 @@ jobs: test-pr-check-bun: if: github.event_name == 'pull_request' - name: runner / textlint (github-pr-check) + name: runner / textlint (github-pr-check, bun) runs-on: ubuntu-latest steps: - name: Checkout