diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 000000000..20443dd36 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,70 @@ +name: test +on: + workflow_dispatch: +jobs: + create-branch: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + ref: ${{ github.ref }} + - name: Create Branch + uses: peterjgrainger/action-create-branch@v2.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + branch: 'bot/auto-update' + sort: + runs-on: ubuntu-latest + needs: create-branch + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + ref: bot/auto-update + - name: Install Dependencies + run: npm install + - name: Sort Channels + run: node scripts/sort.js + - name: Commit Changes + uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: '[Bot] Sort channels' + commit_user_name: iptv-bot + commit_user_email: 84861620+iptv-bot[bot]@users.noreply.github.com + commit_author: 'iptv-bot[bot] <84861620+iptv-bot[bot]@users.noreply.github.com>' + branch: bot/auto-update + file_pattern: channels/* + pull-request: + needs: sort + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + ref: bot/auto-update + - name: Generate Token + uses: tibdex/github-app-token@v1 + id: generate-token + with: + app_id: ${{ secrets.APP_ID }} + private_key: ${{ secrets.APP_PRIVATE_KEY }} + - name: Fetch Origin + run: git fetch origin --allow-unrelated-histories + - name: Update from master + run: git merge origin/master + - name: Create Pull Request + id: pr + uses: peter-evans/create-pull-request@v3 + with: + title: '[Bot] Update playlists' + body: | + This pull request is created by [auto-update][1] workflow. + + [1]: https://github.com/iptv-org/iptv/actions/runs/${{ github.run_id }} + author: 'iptv-bot[bot] <84861620+iptv-bot[bot]@users.noreply.github.com>' + branch: 'bot/auto-update' + delete-branch: false + base: master + token: ${{ steps.generate-token.outputs.token }}