From 5db8f710e22170deaa4cc3e718398bda9d2a3885 Mon Sep 17 00:00:00 2001 From: Clockwork Date: Tue, 30 Jan 2024 11:36:12 +0200 Subject: [PATCH] chore: lint test (#10) * chore: lint test * fix: linting * chore: Run checks on PR head --- .github/workflows/lint.yml | 13 ++++++++++--- .github/workflows/test-coverage.yml | 2 ++ .github/workflows/test-vitest.yml | 4 +++- src/utils/index.ts | 2 +- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 351e79b..cdf7240 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,16 +1,21 @@ name: Linting + on: pull_request_target: types: - opened - edited - synchronize + + jobs: lint: name: Lint runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} - uses: pnpm/action-setup@v2 with: version: 8 @@ -22,7 +27,9 @@ jobs: - name: Install dependencies run: pnpm install - name: Run eslint on changed files - uses: reviewdog/action-eslint@v1 + uses: tj-actions/eslint-changed-files@v23 with: - reporter: github-pr-check - eslint_flags: " -c .eslintrc.js './src/**/*.ts' --max-warnings=0 --ignore-path .gitignore" + config_path: ".eslintrc.js" + ignore_path: ".gitignore" + file_extensions: './src/**/*.ts' + extra_args: "--max-warnings=0" diff --git a/.github/workflows/test-coverage.yml b/.github/workflows/test-coverage.yml index 6297c67..bd314e9 100644 --- a/.github/workflows/test-coverage.yml +++ b/.github/workflows/test-coverage.yml @@ -20,6 +20,8 @@ jobs: steps: - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} - uses: pnpm/action-setup@v2 with: version: 8 diff --git a/.github/workflows/test-vitest.yml b/.github/workflows/test-vitest.yml index 53b2f84..29b1c9b 100644 --- a/.github/workflows/test-vitest.yml +++ b/.github/workflows/test-vitest.yml @@ -13,7 +13,9 @@ jobs: name: Unit tests runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} - uses: pnpm/action-setup@v2 with: version: 8 diff --git a/src/utils/index.ts b/src/utils/index.ts index da37638..9d4eb7f 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -3,5 +3,5 @@ export function toHexString(byteArray: ArrayLike) { .call(byteArray, function (byte) { return ("0" + (byte & 0xff).toString(16)).slice(-2); }) - .join(""); + .join(""); }