Files
twscrape/.github/workflows/pr.yml
T
2026-05-21 16:04:45 +03:00

44 lines
1.5 KiB
YAML

name: pr
on:
pull_request:
pull_request_target:
types: [opened, reopened]
permissions: read-all
jobs:
test:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v6
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
python-version: ${{ matrix.python-version }}
- run: uv sync --frozen
- run: make check
- run: make test
maintainer-edits:
if: github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Warn if maintainer edits disabled
if: "!github.event.pull_request.maintainer_can_modify"
uses: actions/github-script@v7
with:
script: |
await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Please enable **[Allow edits from maintainers](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork#enabling-repository-maintainer-permissions-on-existing-pull-requests)** on this PR — this lets us push fixes directly to your branch without waiting for you to resolve conflicts manually.'
})