| 1 |
name: Label Approved |
| 2 |
|
| 3 |
on: |
| 4 |
schedule: |
| 5 |
- cron: "0 12 * * *" |
| 6 |
workflow_dispatch: |
| 7 |
|
| 8 |
permissions: {} |
| 9 |
|
| 10 |
jobs: |
| 11 |
label-approved: |
| 12 |
if: github.repository_owner == 'fastapi' |
| 13 |
runs-on: ubuntu-latest |
| 14 |
permissions: |
| 15 |
pull-requests: write |
| 16 |
timeout-minutes: 7 |
| 17 |
steps: |
| 18 |
- name: Dump GitHub context |
| 19 |
env: |
| 20 |
GITHUB_CONTEXT: ${{ toJson(github) }} |
| 21 |
run: echo "$GITHUB_CONTEXT" |
| 22 |
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 |
| 23 |
with: |
| 24 |
persist-credentials: false |
| 25 |
- name: Set up Python |
| 26 |
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 |
| 27 |
with: |
| 28 |
python-version-file: ".python-version" |
| 29 |
- name: Setup uv |
| 30 |
uses: astral-sh/setup-uv@d31148d669074a8d0a63714ba94f3201e7020bc3 # v8.3.0 |
| 31 |
with: |
| 32 |
# Before upgrading uv version, make sure astral-sh/setup-uv knows its checksum. |
| 33 |
# See: https://github.com/astral-sh/setup-uv/issues/851#issuecomment-4282017837 |
| 34 |
version: "0.11.18" |
| 35 |
enable-cache: true |
| 36 |
cache-dependency-glob: | |
| 37 |
pyproject.toml |
| 38 |
uv.lock |
| 39 |
- name: Install GitHub Actions dependencies |
| 40 |
run: uv sync --locked --no-dev --group github-actions |
| 41 |
- name: Label Approved |
| 42 |
run: uv run ./scripts/label_approved.py |
| 43 |
env: |
| 44 |
TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 45 |
CONFIG: > |
| 46 |
{ |
| 47 |
"approved-1": |
| 48 |
{ |
| 49 |
"number": 1, |
| 50 |
"await_label": "awaiting-review" |
| 51 |
} |
| 52 |
} |