ci: add useragents workflow

- Update user agents once a month, open pull request via streamlinkbot
- Ignore CI runs when pushing branches with automated changes
This commit is contained in:
bastimeyer 2022-06-03 03:50:52 +02:00 committed by Sebastian Meyer
parent e3e3f118e5
commit 2f101a8172
2 changed files with 35 additions and 1 deletions

View File

@ -1,7 +1,9 @@
name: Test, build and deploy
on:
push: {}
push:
branches-ignore:
- 'automated/**'
pull_request: {}
schedule:
- cron: '0 0 * * *'

32
.github/workflows/useragents.yml vendored Normal file
View File

@ -0,0 +1,32 @@
name: Update user agents
on:
schedule:
- cron: '0 0 1 * *'
jobs:
update-user-agents:
if: github.repository == 'streamlink/streamlink'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: "3.10"
- run: python -m pip install requests
- run: python ./script/update-user-agents.py
env:
WHATISMYBROWSER_API_KEY: ${{ secrets.WHATISMYBROWSER_API_KEY }}
- uses: peter-evans/create-pull-request@10db75894f6d53fc01c3bb0995e95bd03e583a62
with:
token: ${{ secrets.STREAMLINKBOT_USERAGENTS_PR }}
add-paths: |
src/streamlink/plugin/api/useragents.py
commit-message: "plugin.api: update useragents"
committer: "streamlinkbot <streamlinkbot@users.noreply.github.com>"
author: "streamlinkbot <streamlinkbot@users.noreply.github.com>"
branch: "automated/plugin/api/useragents"
branch-suffix: timestamp
delete-branch: true
title: "plugin.api: update useragents"
body: "Automated pull request"