| 1 |
name: FastAPI People Sponsors |
| 2 |
|
| 3 |
on: |
| 4 |
schedule: |
| 5 |
- cron: "0 6 1 * *" |
| 6 |
workflow_dispatch: |
| 7 |
inputs: |
| 8 |
debug_enabled: |
| 9 |
description: "Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)" |
| 10 |
required: false |
| 11 |
default: "false" |
| 12 |
|
| 13 |
permissions: {} |
| 14 |
|
| 15 |
jobs: |
| 16 |
job: |
| 17 |
if: github.repository_owner == 'fastapi' |
| 18 |
runs-on: ubuntu-latest |
| 19 |
permissions: |
| 20 |
contents: write |
| 21 |
timeout-minutes: 5 |
| 22 |
steps: |
| 23 |
- name: Dump GitHub context |
| 24 |
env: |
| 25 |
GITHUB_CONTEXT: ${{ toJson(github) }} |
| 26 |
run: echo "$GITHUB_CONTEXT" |
| 27 |
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 |
| 28 |
with: |
| 29 |
persist-credentials: true # Required for `git push` in `sponsors.py` |
| 30 |
- name: Set up Python |
| 31 |
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 |
| 32 |
with: |
| 33 |
python-version-file: ".python-version" |
| 34 |
- name: Setup uv |
| 35 |
uses: astral-sh/setup-uv@d31148d669074a8d0a63714ba94f3201e7020bc3 # v8.3.0 |
| 36 |
with: |
| 37 |
# Before upgrading uv version, make sure astral-sh/setup-uv knows its checksum. |
| 38 |
# See: https://github.com/astral-sh/setup-uv/issues/851#issuecomment-4282017837 |
| 39 |
version: "0.11.18" |
| 40 |
enable-cache: true |
| 41 |
cache-dependency-glob: | |
| 42 |
pyproject.toml |
| 43 |
uv.lock |
| 44 |
- name: Install Dependencies |
| 45 |
run: uv sync --locked --no-dev --group github-actions |
| 46 |
# Allow debugging with tmate |
| 47 |
- name: Setup tmate session |
| 48 |
uses: mxschmitt/action-tmate@35b54afac29c97fb54faba5b513f8fbd1882f113 # v3.24 |
| 49 |
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled == 'true' }} |
| 50 |
with: |
| 51 |
limit-access-to-actor: true |
| 52 |
- name: FastAPI People Sponsors |
| 53 |
run: uv run ./scripts/sponsors.py |
| 54 |
env: |
| 55 |
SPONSORS_TOKEN: ${{ secrets.SPONSORS_TOKEN }} # zizmor: ignore[secrets-outside-env] |
| 56 |
PR_TOKEN: ${{ secrets.FASTAPI_PR_TOKEN }} # zizmor: ignore[secrets-outside-env] |