diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 75a7eb93b..ad1bd9022 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -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 diff --git a/package.json b/package.json index 3bf32fbfc..55ec7891f 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "iptv", "scripts": { "act:check": "act pull_request -W .github/workflows/check.yml", - "act:format": "act pull_request -W .github/workflows/format.yml -e act.json", + "act:format": "act workflow_dispatch -W .github/workflows/format.yml", "act:update": "act workflow_dispatch -W .github/workflows/update.yml", "api:load": "./scripts/commands/api/load.sh", "api:generate": "npm run ts-node scripts/commands/api/generate.ts",