From 6b5bfd52917de46daf59df103d2fb0ce95443838 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Sun, 12 Dec 2021 07:39:44 +0300 Subject: [PATCH] Update cleanup.yml --- .github/workflows/cleanup.yml | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/.github/workflows/cleanup.yml b/.github/workflows/cleanup.yml index fb7a67d447..ff86dc62ad 100644 --- a/.github/workflows/cleanup.yml +++ b/.github/workflows/cleanup.yml @@ -6,28 +6,34 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - run: echo "::set-output name=branch_name::$(date +'bot/cleanup-%s')" + id: create-branch-name + - run: | + git config user.name 'iptv-bot[bot]' + git config user.email '84861620+iptv-bot[bot]@users.noreply.github.com' + - run: git checkout -b ${{ steps.create-branch-name.outputs.branch_name }} - run: npm install - run: node scripts/commands/create-database.js - run: node scripts/commands/cleanup-database.js - run: node scripts/commands/update-playlists.js + - run: | + git add channels/* + git commit -m "[Bot] Update playlists" - uses: tibdex/github-app-token@v1 if: ${{ !env.ACT }} id: create-app-token with: app_id: ${{ secrets.APP_ID }} private_key: ${{ secrets.APP_PRIVATE_KEY }} - - uses: peter-evans/create-pull-request@v3 + - uses: repo-sync/pull-request@v2 if: ${{ github.ref == 'refs/heads/master' }} - token: ${{ steps.create-app-token.outputs.token }} - commit-message: '[Bot] Update playlists' - committer: 'iptv-bot[bot] <84861620+iptv-bot[bot]@users.noreply.github.com>' - author: 'iptv-bot[bot] <84861620+iptv-bot[bot]@users.noreply.github.com>' - branch: bot/cleanup - branch-suffix: timestamp - delete-branch: true - base: master - title: '[Bot] Remove broken links' - body: | - This pull request is created by [cleanup][1] workflow. + id: pull-request + with: + github_token: ${{ steps.create-app-token.outputs.token }} + source_branch: ${{ steps.create-branch-name.outputs.branch_name }} + destination_branch: 'master' + pr_title: '[Bot] Remove broken links' + pr_body: | + This pull request is created by [cleanup][1] workflow. - [1]: https://github.com/iptv-org/iptv/actions/runs/${{ github.run_id }} + [1]: https://github.com/iptv-org/iptv/actions/runs/${{ github.run_id }}