iptv/.github/workflows/check.yml

37 lines
1.2 KiB
YAML
Raw Normal View History

2021-04-27 19:46:30 +02:00
name: check
on:
workflow_dispatch:
pull_request:
types: [opened, synchronize, reopened, edited]
2022-03-18 14:37:32 +01:00
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
2021-04-27 19:46:30 +02:00
jobs:
2021-12-12 05:08:29 +01:00
check:
2021-04-27 19:46:30 +02:00
runs-on: ubuntu-latest
steps:
2021-12-12 05:08:29 +01:00
- uses: actions/checkout@v2
2022-02-15 20:51:30 +01:00
with:
2022-02-22 18:05:00 +01:00
fetch-depth: 2
2022-06-09 14:14:25 +02:00
- uses: tj-actions/changed-files@v22.2
2022-02-14 23:53:05 +01:00
id: files
with:
2022-06-09 14:14:25 +02:00
files: streams/*.m3u
2021-12-12 05:08:29 +01:00
- uses: actions/setup-node@v2
2022-02-14 23:53:05 +01:00
if: ${{ !env.ACT && steps.files.outputs.any_changed == 'true' }}
2021-12-12 05:08:29 +01:00
with:
node-version: '14'
cache: 'npm'
2022-02-14 23:53:05 +01:00
- name: download data from api
if: steps.files.outputs.any_changed == 'true'
2022-02-14 10:00:05 +01:00
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
2022-02-14 23:53:05 +01:00
- name: validate
if: steps.files.outputs.any_changed == 'true'
run: |
npm install
npm run playlist:lint -- ${{ steps.files.outputs.all_changed_files }}
npm run playlist:validate -- ${{ steps.files.outputs.all_changed_files }}