mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 00:50:09 -04:00
Update update-codes.yml
This commit is contained in:
parent
869c11a44a
commit
04e5300075
1 changed files with 0 additions and 70 deletions
70
.github/workflows/update-codes.yml
vendored
70
.github/workflows/update-codes.yml
vendored
|
@ -4,85 +4,15 @@ on:
|
|||
schedule:
|
||||
- cron: '0 6 * * *'
|
||||
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/update-codes'
|
||||
update-codes:
|
||||
runs-on: ubuntu-latest
|
||||
needs: create-branch
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
ref: bot/update-codes
|
||||
- name: Install Dependencies
|
||||
run: npm install
|
||||
- name: Update Codes
|
||||
run: npm run update-codes
|
||||
- name: Commit Changes
|
||||
uses: stefanzweifel/git-auto-commit-action@v4
|
||||
with:
|
||||
commit_message: '[Bot] Update codes'
|
||||
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/update-codes
|
||||
file_pattern: .gh-pages/_items.json .gh-pages/codes.json
|
||||
pull-request:
|
||||
needs: update-codes
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
ref: bot/update-codes
|
||||
- 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: Create Pull Request
|
||||
id: pr
|
||||
uses: repo-sync/pull-request@v2
|
||||
with:
|
||||
source_branch: 'bot/update-codes'
|
||||
destination_branch: 'master'
|
||||
pr_title: '[Bot] Update codes'
|
||||
pr_body: |
|
||||
This pull request is created by [update-codes][1] workflow.
|
||||
|
||||
[1]: https://github.com/iptv-org/iptv/actions/runs/${{ github.run_id }}
|
||||
github_token: ${{ steps.generate-token.outputs.token }}
|
||||
- name: Check Outputs
|
||||
run: echo "Pull Request Number - ${{ steps.pr.outputs.pr_number }}"
|
||||
- name: Enable Pull Request Automerge
|
||||
uses: peter-evans/enable-pull-request-automerge@v1
|
||||
with:
|
||||
token: ${{ secrets.PAT }}
|
||||
pull-request-number: ${{ steps.pr.outputs.pr_number }}
|
||||
merge-method: squash
|
||||
- name: Approve Pull Request
|
||||
uses: juliangruber/approve-pull-request-action@v1
|
||||
with:
|
||||
github-token: ${{ secrets.PAT }}
|
||||
number: ${{ steps.pr.outputs.pr_number }}
|
||||
deploy:
|
||||
needs: pull-request
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Generate Token
|
||||
uses: tibdex/github-app-token@v1
|
||||
id: generate-token
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue