| 1 |
name: Update Plugin List |
| 2 |
|
| 3 |
on: |
| 4 |
schedule: |
| 5 |
# At 00:00 on Sunday. |
| 6 |
# https://crontab.guru |
| 7 |
- cron: '0 0 * * 0' |
| 8 |
workflow_dispatch: |
| 9 |
|
| 10 |
# Set permissions at the job level. |
| 11 |
permissions: {} |
| 12 |
|
| 13 |
jobs: |
| 14 |
update-plugin-list: |
| 15 |
if: github.repository_owner == 'pytest-dev' |
| 16 |
runs-on: ubuntu-latest |
| 17 |
permissions: |
| 18 |
contents: write |
| 19 |
pull-requests: write |
| 20 |
|
| 21 |
steps: |
| 22 |
- name: Checkout |
| 23 |
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 24 |
with: |
| 25 |
fetch-depth: 0 |
| 26 |
persist-credentials: false |
| 27 |
|
| 28 |
- name: Setup Python |
| 29 |
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 |
| 30 |
with: |
| 31 |
python-version: "3.13" |
| 32 |
|
| 33 |
- name: requests-cache |
| 34 |
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 |
| 35 |
with: |
| 36 |
path: ~/.cache/pytest-plugin-list/ |
| 37 |
key: plugins-http-cache-${{ github.run_id }} # Can use time based key as well |
| 38 |
restore-keys: plugins-http-cache- |
| 39 |
|
| 40 |
- name: Install tox |
| 41 |
run: | |
| 42 |
python -m pip install --upgrade pip |
| 43 |
pip install tox |
| 44 |
|
| 45 |
- name: Update Plugin List |
| 46 |
run: tox -e update-plugin-list |
| 47 |
|
| 48 |
- name: Create Pull Request |
| 49 |
id: pr |
| 50 |
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 |
| 51 |
with: |
| 52 |
commit-message: '[automated] Update plugin list' |
| 53 |
author: 'pytest bot <[email protected]>' |
| 54 |
branch: update-plugin-list/patch |
| 55 |
delete-branch: true |
| 56 |
branch-suffix: short-commit-hash |
| 57 |
title: '[automated] Update plugin list' |
| 58 |
body: '[automated] Update plugin list' |
| 59 |
draft: true |
| 60 |
|
| 61 |
- name: Instruct the maintainers to trigger CI by undrafting the PR |
| 62 |
env: |
| 63 |
GITHUB_TOKEN: ${{ github.token }} |
| 64 |
PULL_REQUEST_NUMBER: ${{ steps.pr.outputs.pull-request-number }} |
| 65 |
run: >- |
| 66 |
gh pr comment |
| 67 |
--body 'Please mark the PR as ready for review to trigger PR checks.' |
| 68 |
--repo '${{ github.repository }}' |
| 69 |
"$PULL_REQUEST_NUMBER" |