From 2f670a54670a60dddc79e705502d6905d85a4932 Mon Sep 17 00:00:00 2001 From: freearhey <7253922+freearhey@users.noreply.github.com> Date: Wed, 1 Jan 2025 13:03:48 +0300 Subject: [PATCH] Create check.yml --- .github/workflows/check.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/check.yml diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 00000000..7bf7ec33 --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,35 @@ +name: check +on: + workflow_dispatch: + pull_request: + types: [opened, synchronize, reopened, edited] +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 2 + - uses: tj-actions/changed-files@v45 + id: files + with: + files: | + tests/**/*.{js,ts} + scripts/**/*.{js,ts} + sites/**/*.{js,ts} + - run: echo ${{ steps.files.outputs.all_changed_files }} + - uses: actions/setup-node@v4 + if: ${{ !env.ACT && steps.files.outputs.any_changed == 'true' }} + with: + node-version: 22 + cache: 'npm' + - name: install dependencies + if: steps.files.outputs.any_changed == 'true' + run: npm install + - name: check changed files + if: steps.files.outputs.any_changed == 'true' + run: | + npx eslint ${{ steps.files.outputs.all_changed_files }} \ No newline at end of file