iptv/.github/workflows/auto-update.yml

67 lines
2.0 KiB
YAML
Raw Normal View History

2021-02-08 12:05:46 +01:00
name: auto-update
2021-02-08 11:53:24 +01:00
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
jobs:
2021-08-02 03:13:25 +02:00
create-branch:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
2021-08-02 03:18:18 +02:00
with:
2021-08-03 06:30:37 +02:00
ref: ${{ github.ref }}
2021-08-03 06:20:34 +02:00
- name: Create Branch
uses: peterjgrainger/action-create-branch@v2.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
branch: 'bot/auto-update'
2021-08-02 20:34:54 +02:00
sort:
2021-07-13 18:18:04 +02:00
runs-on: ubuntu-latest
2021-08-03 07:12:42 +02:00
needs: create-branch
2021-08-01 06:13:18 +02:00
steps:
- name: Checkout
uses: actions/checkout@v2
2021-08-02 03:13:25 +02:00
with:
ref: bot/auto-update
2021-08-02 20:34:54 +02:00
- 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/*
2021-05-26 15:10:28 +02:00
pull-request:
2021-08-03 07:12:42 +02:00
needs: sort
2021-05-26 15:10:28 +02:00
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
2021-08-03 04:34:41 +02:00
with:
2021-08-03 05:20:11 +02:00
ref: bot/auto-update
2021-05-26 17:23:27 +02:00
- name: Generate Token
uses: tibdex/github-app-token@v1
2021-08-03 02:23:24 +02:00
id: generate-token
2021-05-26 17:23:27 +02:00
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
2021-05-26 15:10:28 +02:00
- name: Create Pull Request
2021-05-26 16:16:58 +02:00
id: pr
2021-08-03 07:26:55 +02:00
uses: repo-sync/pull-request@v2
2021-05-26 15:10:28 +02:00
with:
2021-08-03 07:26:55 +02:00
source_branch: 'bot/auto-update'
destination_branch: 'master'
pr_title: '[Bot] Update playlists'
pr_body: |
2021-08-03 03:30:15 +02:00
This pull request is created by [auto-update][1] workflow.
2021-08-02 04:43:08 +02:00
2021-08-03 03:30:15 +02:00
[1]: https://github.com/iptv-org/iptv/actions/runs/${{ github.run_id }}
2021-08-03 07:26:55 +02:00
github_token: ${{ steps.generate-token.outputs.token }}