Mystique/.forgejo/workflows/validate.yaml
2025-01-28 22:50:37 +00:00

34 lines
947 B
YAML

name: M3U Lint and Sort
on:
push:
paths:
- 'mystique.m3u'
jobs:
lint-and-sort:
runs-on: docker
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install m3u-linter
run: npm install -g m3u-linter
- name: Sort M3U file
run: node .forgejo/scripts/sort-m3u.js mystique.m3u
- name: Run M3U linter
run: m3u-linter --config .forgejo/scripts/m3u-linter.config.json mystique.m3u
- name: Commit changes if file was modified
run: |
git config --global user.name 'Forgejo Actions Bot'
git config --global user.email 'forgejo-actions[bot]@noreply.forgejo.org'
git add mystique.m3u
git diff --quiet && git diff --staged --quiet || (git commit -m "Sort M3U by group-title" && git push)