diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7e5a5f85..49fedcb9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,7 +1,9 @@ name: Test, build and deploy on: - push: {} + push: + branches-ignore: + - 'automated/**' pull_request: {} schedule: - cron: '0 0 * * *' diff --git a/.github/workflows/useragents.yml b/.github/workflows/useragents.yml new file mode 100644 index 00000000..bc48da12 --- /dev/null +++ b/.github/workflows/useragents.yml @@ -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 " + author: "streamlinkbot " + branch: "automated/plugin/api/useragents" + branch-suffix: timestamp + delete-branch: true + title: "plugin.api: update useragents" + body: "Automated pull request"