Update cleanup.yml

This commit is contained in:
Aleksandr Statciuk 2021-12-12 07:39:44 +03:00
parent 27fd83af15
commit 6b5bfd5291
1 changed files with 19 additions and 13 deletions

View File

@ -6,28 +6,34 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - 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: npm install
- run: node scripts/commands/create-database.js - run: node scripts/commands/create-database.js
- run: node scripts/commands/cleanup-database.js - run: node scripts/commands/cleanup-database.js
- run: node scripts/commands/update-playlists.js - run: node scripts/commands/update-playlists.js
- run: |
git add channels/*
git commit -m "[Bot] Update playlists"
- uses: tibdex/github-app-token@v1 - uses: tibdex/github-app-token@v1
if: ${{ !env.ACT }} if: ${{ !env.ACT }}
id: create-app-token id: create-app-token
with: with:
app_id: ${{ secrets.APP_ID }} app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }} 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' }} if: ${{ github.ref == 'refs/heads/master' }}
token: ${{ steps.create-app-token.outputs.token }} id: pull-request
commit-message: '[Bot] Update playlists' with:
committer: 'iptv-bot[bot] <84861620+iptv-bot[bot]@users.noreply.github.com>' github_token: ${{ steps.create-app-token.outputs.token }}
author: 'iptv-bot[bot] <84861620+iptv-bot[bot]@users.noreply.github.com>' source_branch: ${{ steps.create-branch-name.outputs.branch_name }}
branch: bot/cleanup destination_branch: 'master'
branch-suffix: timestamp pr_title: '[Bot] Remove broken links'
delete-branch: true pr_body: |
base: master
title: '[Bot] Remove broken links'
body: |
This pull request is created by [cleanup][1] workflow. 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 }}