Update cleanup.yml

pull/5690/head
Aleksandr Statciuk 3 years ago
parent c02b14c785
commit cd0d26d08a

@ -2,65 +2,32 @@ name: cleanup
on: on:
workflow_dispatch: workflow_dispatch:
jobs: jobs:
create-branch: cleanup:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - uses: actions/checkout@v2
uses: actions/checkout@v2 - run: npm install
with: - run: node scripts/commands/create-database.js
ref: ${{ github.ref }} - run: node scripts/commands/cleanup-database.js
- name: Create Branch - run: node scripts/commands/update-playlists.js
uses: peterjgrainger/action-create-branch@v2.0.1 - uses: tibdex/github-app-token@v1
env: if: ${{ !env.ACT }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} id: create-app-token
with:
branch: 'bot/cleanup'
remove-broken-links:
runs-on: ubuntu-latest
needs: create-branch
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: bot/cleanup
- name: Install Dependencies
run: npm install
- name: Remove Broken Links
run: node scripts/remove-broken-links.js
- name: Commit Changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: '[Bot] Remove broken links'
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/cleanup
file_pattern: channels/*
pull-request:
if: ${{ github.ref == 'refs/heads/master' }}
runs-on: ubuntu-latest
needs: remove-broken-links
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: bot/cleanup
- name: Generate Token
uses: tibdex/github-app-token@v1
id: generate-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 }}
- name: Create Pull Request - uses: peter-evans/create-pull-request@v3
id: pr if: ${{ github.ref == 'refs/heads/master' }}
uses: repo-sync/pull-request@v2 token: ${{ steps.create-app-token.outputs.token }}
with: commit-message: '[Bot] Update playlists'
source_branch: 'bot/cleanup' committer: 'iptv-bot[bot] <84861620+iptv-bot[bot]@users.noreply.github.com>'
destination_branch: 'master' author: 'iptv-bot[bot] <84861620+iptv-bot[bot]@users.noreply.github.com>'
pr_title: '[Bot] Cleaning playlists' branch: bot/cleanup
pr_body: | branch-suffix: timestamp
This pull request is created by [cleanup][1] workflow. delete-branch: true
base: master
title: '[Bot] Remove broken links'
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 }}
pr_draft: true
github_token: ${{ steps.generate-token.outputs.token }}

Loading…
Cancel
Save