Skip to content
Closed
Show file tree
Hide file tree
Changes from 9 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
19 changes: 19 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,22 @@ jobs:
with:
python-version: "3.x"
- uses: pre-commit/action@v3.0.0

patchcheck:
if: "github.repository == 'python/cpython' && github.event_name == 'pull_request'"
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
Comment thread
sobolevn marked this conversation as resolved.
Outdated
ref: ${{ github.event.pull_request.head.ref }}
Comment thread
sobolevn marked this conversation as resolved.
Outdated
repository: ${{ github.event.pull_request.head.repo.full_name }}
Comment thread
sobolevn marked this conversation as resolved.
Outdated
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: "Run patchcheck"
run: |
git status && git branch
Comment thread
sobolevn marked this conversation as resolved.
Outdated
python Tools/patchcheck/patchcheck.py --ci true
2 changes: 2 additions & 0 deletions Tools/patchcheck/patchcheck.py
Comment thread
sobolevn marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ def get_git_remote_default_branch(remote_name):
info=lambda x: x if x is not None else "not a PR branch")
def get_base_branch():
if not os.path.exists(os.path.join(SRCDIR, '.git')):
print('No', SRCDIR)
# Not a git checkout, so there's no base branch
return None
upstream_remote = get_git_upstream_remote()
Expand All @@ -108,6 +109,7 @@ def get_base_branch():
else:
base_branch = "{0.major}.{0.minor}".format(version)
this_branch = get_git_branch()
print(locals())
if this_branch is None or this_branch == base_branch:
# Not on a git PR branch, so there's no base branch
return None
Expand Down