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

32 lines
1.1 KiB
YAML
Raw Normal View History

2023-04-08 20:39:08 -04:00
name: update
on:
workflow_dispatch:
2023-04-11 17:50:43 -04:00
schedule:
- cron: '0 0 * * *'
2023-04-08 20:39:08 -04:00
jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: tibdex/github-app-token@v1
id: create-app-token
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
2023-05-25 12:39:17 -04:00
- uses: actions/checkout@v3
with:
token: ${{ steps.create-app-token.outputs.token }}
2023-04-08 20:39:08 -04:00
- run: npm install
2023-06-29 06:25:49 -04:00
- run: npm run db:update --silent >> $GITHUB_OUTPUT
2023-05-24 16:37:02 -04:00
id: issue-process
2023-05-25 12:43:16 -04:00
- name: Validate Changes
run: npm run db:validate
2023-05-24 16:37:02 -04:00
- name: Commit Changes
2023-05-24 17:12:16 -04:00
if: steps.issue-process.outputs.OUTPUT != 0
2023-05-24 16:37:02 -04:00
run: |
2023-05-26 00:34:37 -04:00
git config user.name "iptv-bot[bot]"
git config user.email "84861620+iptv-bot[bot]@users.noreply.github.com"
2023-05-24 16:37:02 -04:00
git add data/channels.csv
2023-05-25 12:43:16 -04:00
git commit -m "[Bot] Update channels.csv" -m "Committed by [iptv-bot](https://github.com/apps/iptv-bot) via [update](https://github.com/iptv-org/database/actions/runs/${{ github.run_id }}) workflow." -m "${{ steps.issue-process.outputs.OUTPUT }}" --no-verify
2023-05-24 16:37:02 -04:00
git status
2023-05-25 13:35:34 -04:00
git push