Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/check_pr_quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: PR Quality Checks

on:
pull_request_target:
types: [ edited, opened, reopened, ready_for_review, synchronize ]
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true

permissions:
contents: read
pull-requests: write

jobs:
pr_quality:
name: Run Quality Checks on a PR
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v6
with:
persist-credentials: false
# Checking out the default branch (not the PR head) is what makes
# pull_request_target safe: the workflow code always comes from the
# base repo, so a malicious PR cannot alter it.
ref: ${{ github.event.repository.default_branch }}
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.14'
- name: Run PR quality checks
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_AUTHOR: ${{ github.event.pull_request.user.login }}
PR_BODY: ${{ github.event.pull_request.body }}
PR_TITLE: ${{ github.event.pull_request.title }}
PR_CREATED_AT: ${{ github.event.pull_request.created_at }}
PR_NUMBER: ${{ github.event.pull_request.number }}
PR_REPO: ${{ github.repository }}
# Only close PRs on the main Django repository; on forks the workflow
# runs in warning-only mode so contributors can test their PRs.
AUTOCLOSE: ${{ github.repository == 'django/django' }}
PYTHONPATH: scripts
run: python scripts/pr_quality/check_pr.py
15 changes: 15 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,18 @@ jobs:
cache-dependency-path: '**/package.json'
- run: npm install
- run: npm test

scripts-tests:
runs-on: ubuntu-latest
name: Scripts tests
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.14'
- run: python -m unittest discover -v -s scripts/
Empty file added scripts/pr_quality/__init__.py
Empty file.
Loading
Loading