From 0322922c3980a1808ab7cc0b5f509e1ccb193236 Mon Sep 17 00:00:00 2001 From: freearhey <7253922+freearhey@users.noreply.github.com> Date: Tue, 20 Jun 2023 09:56:34 +0300 Subject: [PATCH] Create check.yml --- .github/workflows/check.yml | 38 +++++++++++++++++++++++++++++++++++++ 1 file changed, 38 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 000000000..665c1f967 --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,38 @@ +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@v3 + with: + fetch-depth: 2 + - uses: tj-actions/changed-files@v35 + id: files + with: + files: streams/*.m3u + - uses: actions/setup-node@v3 + if: ${{ !env.ACT && steps.files.outputs.any_changed == 'true' }} + with: + node-version: 16 + cache: 'npm' + - name: download data from api + if: steps.files.outputs.any_changed == 'true' + run: | + mkdir -p scripts/data + curl -L -o scripts/data/blocklist.json https://iptv-org.github.io/api/blocklist.json + curl -L -o scripts/data/channels.json https://iptv-org.github.io/api/channels.json + - name: install dependencies + if: steps.files.outputs.any_changed == 'true' + run: npm install + - name: validate + if: steps.files.outputs.any_changed == 'true' + run: | + npm run playlist:lint -- ${{ steps.files.outputs.all_changed_files }} + npm run playlist:validate -- ${{ steps.files.outputs.all_changed_files }} \ No newline at end of file