mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 00:50:09 -04:00
Create _update-readme.yml
This commit is contained in:
parent
139d011aac
commit
f25316ade0
1 changed files with 52 additions and 0 deletions
52
.github/workflows/_update-readme.yml
vendored
Normal file
52
.github/workflows/_update-readme.yml
vendored
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
name: _update-readme
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
schedule:
|
||||||
|
- cron: '0 12 * * *'
|
||||||
|
jobs:
|
||||||
|
check:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- run: echo "::set-output name=branch_name::$(date +'bot/auto-update-%s')"
|
||||||
|
id: create-branch-name
|
||||||
|
- run: git config user.name 'iptv-bot[bot]'
|
||||||
|
- run: git config user.email '84861620+iptv-bot[bot]@users.noreply.github.com'
|
||||||
|
- run: git checkout -b ${{ steps.create-branch-name.outputs.branch_name }}
|
||||||
|
- name: Download data from API
|
||||||
|
run: |
|
||||||
|
mkdir -p scripts/data
|
||||||
|
curl -L -o scripts/data/countries.json https://iptv-org.github.io/api/countries.json
|
||||||
|
- run: npm install
|
||||||
|
- run: npm run readme:update
|
||||||
|
- name: Commit Changes
|
||||||
|
if: ${{ !env.ACT }}
|
||||||
|
run: |
|
||||||
|
git add README.md
|
||||||
|
git commit -m "[Bot] Update README.md"
|
||||||
|
git status
|
||||||
|
git push -u origin ${{ steps.create-branch-name.outputs.branch_name }}
|
||||||
|
- 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: repo-sync/pull-request@v2
|
||||||
|
if: ${{ !env.ACT && github.ref == 'refs/heads/master' }}
|
||||||
|
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] Daily update'
|
||||||
|
pr_body: |
|
||||||
|
This pull request is created via [update-readme][1] workflow.
|
||||||
|
|
||||||
|
[1]: https://github.com/iptv-org/epg/actions/runs/${{ github.run_id }}
|
||||||
|
- uses: juliangruber/merge-pull-request-action@v1
|
||||||
|
if: ${{ !env.ACT && github.ref == 'refs/heads/master' }}
|
||||||
|
with:
|
||||||
|
github-token: ${{ secrets.PAT }}
|
||||||
|
number: ${{ steps.pull-request.outputs.pr_number }}
|
||||||
|
method: squash
|
Loading…
Add table
Add a link
Reference in a new issue