Update auto-update.yml

This commit is contained in:
Aleksandr Statciuk 2021-12-14 06:05:36 +03:00
parent 459628cce8
commit f53e698fb0

View File

@ -53,25 +53,12 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: load needs: load
steps: steps:
- uses: tibdex/github-app-token@v1 - uses: actions/checkout@v2
if: ${{ !env.ACT }}
id: create-app-token
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
- run: echo "::set-output name=branch_name::$(date +'bot/auto-update-%s')" - run: echo "::set-output name=branch_name::$(date +'bot/auto-update-%s')"
id: create-branch-name id: create-branch-name
- uses: peterjgrainger/action-create-branch@v2.0.1 - run: git config user.name 'iptv-bot[bot]'
env: - run: git config user.email '84861620+iptv-bot[bot]@users.noreply.github.com'
GITHUB_TOKEN: ${{ steps.create-app-token.outputs.token }} - run: git checkout -b ${{ steps.create-branch-name.outputs.branch_name }}
with:
branch: ${{ steps.create-branch-name.outputs.branch_name }}
- uses: actions/checkout@v2
with:
ref: ${{ steps.create-branch-name.outputs.branch_name }}
- run: |
git config user.name 'iptv-bot[bot]'
git config user.email '84861620+iptv-bot[bot]@users.noreply.github.com'
- run: curl -L -o scripts/data/codes.json https://iptv-org.github.io/epg/codes.json - run: curl -L -o scripts/data/codes.json https://iptv-org.github.io/epg/codes.json
- uses: actions/download-artifact@v2 - uses: actions/download-artifact@v2
with: with:
@ -88,20 +75,25 @@ jobs:
name: database name: database
path: scripts/channels.db path: scripts/channels.db
- run: node scripts/commands/update-playlists.js - run: node scripts/commands/update-playlists.js
- run: | - run: git add channels/*
git add channels/* - run: git commit -m "[Bot] Update playlists"
git commit -m "[Bot] Update playlists"
- run: node scripts/commands/generate-playlists.js - run: node scripts/commands/generate-playlists.js
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v2
with: with:
name: logs name: logs
path: scripts/logs path: scripts/logs
- run: node scripts/commands/update-readme.js - run: node scripts/commands/update-readme.js
- run: | - run: git add README.md
git add README.md - run: git commit -m "[Bot] Update README.md"
git commit -m "[Bot] Update README.md" - run: 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 - uses: repo-sync/pull-request@v2
# if: ${{ github.ref == 'refs/heads/master' }} if: ${{ !env.ACT }}
id: pull-request id: pull-request
with: with:
github_token: ${{ steps.create-app-token.outputs.token }} github_token: ${{ steps.create-app-token.outputs.token }}