|
|
|
@ -1,11 +1,12 @@
|
|
|
|
|
name: format
|
|
|
|
|
on:
|
|
|
|
|
pull_request:
|
|
|
|
|
types:
|
|
|
|
|
- closed
|
|
|
|
|
workflow_dispatch:
|
|
|
|
|
# pull_request:
|
|
|
|
|
# types:
|
|
|
|
|
# - closed
|
|
|
|
|
jobs:
|
|
|
|
|
main:
|
|
|
|
|
if: ${{ github.event.pull_request.merged == true }}
|
|
|
|
|
# if: ${{ github.event.pull_request.merged == true }}
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
permissions:
|
|
|
|
|
contents: write
|
|
|
|
@ -33,35 +34,29 @@ jobs:
|
|
|
|
|
with:
|
|
|
|
|
files: streams/*.m3u
|
|
|
|
|
- name: download data from api
|
|
|
|
|
if: ${{ !env.ACT && steps.files.outputs.any_changed == 'true' }}
|
|
|
|
|
run: |
|
|
|
|
|
mkdir -p temp/data
|
|
|
|
|
curl -L -o temp/data/blocklist.json https://iptv-org.github.io/api/blocklist.json
|
|
|
|
|
curl -L -o temp/data/channels.json https://iptv-org.github.io/api/channels.json
|
|
|
|
|
- uses: actions/setup-node@v3
|
|
|
|
|
if: ${{ !env.ACT && steps.files.outputs.any_changed == 'true' }}
|
|
|
|
|
if: ${{ !env.ACT }}
|
|
|
|
|
with:
|
|
|
|
|
node-version: 18
|
|
|
|
|
cache: 'npm'
|
|
|
|
|
- name: install dependencies
|
|
|
|
|
if: steps.files.outputs.any_changed == 'true'
|
|
|
|
|
run: npm install
|
|
|
|
|
- name: format internal playlists
|
|
|
|
|
if: steps.files.outputs.any_changed == 'true'
|
|
|
|
|
run: npm run playlist:format -- ${{ steps.files.outputs.all_changed_files }}
|
|
|
|
|
run: npm run playlist:format
|
|
|
|
|
- name: check internal playlists
|
|
|
|
|
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 }}
|
|
|
|
|
npm run playlist:lint
|
|
|
|
|
npm run playlist:validate
|
|
|
|
|
- run: git status
|
|
|
|
|
if: steps.files.outputs.any_changed == 'true'
|
|
|
|
|
- name: commit changes to /streams
|
|
|
|
|
if: steps.files.outputs.any_changed == 'true'
|
|
|
|
|
run: |
|
|
|
|
|
git add streams
|
|
|
|
|
git status
|
|
|
|
|
git commit -m "[Bot] Format /streams" -m "Committed by [iptv-bot](https://github.com/apps/iptv-bot) via [format](https://github.com/iptv-org/iptv/actions/runs/${{ github.run_id }}) workflow." --no-verify
|
|
|
|
|
- name: push all changes to the repository
|
|
|
|
|
if: ${{ !env.ACT && github.ref == 'refs/heads/master' && steps.files.outputs.any_changed == 'true' }}
|
|
|
|
|
if: ${{ !env.ACT && github.ref == 'refs/heads/master' }}
|
|
|
|
|
run: git push
|
|
|
|
|