Fail lint CI if the PR doesn't target main (#3477)
Let's skip the check if we're running on a fork just in case someone opens a PR against a branch on said fork as part of a PR review upstream.
This commit is contained in:
parent
4e3303fa08
commit
37542e6485
7
.github/workflows/lint.yml
vendored
7
.github/workflows/lint.yml
vendored
@ -16,6 +16,13 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Assert PR target is main
|
||||
if: github.event_name == 'pull_request' && github.repository == 'psf/black'
|
||||
run: |
|
||||
if [ "$GITHUB_BASE_REF" != "main" ]; then
|
||||
echo "::error::PR targeting '$GITHUB_BASE_REF', please refile targeting 'main'." && exit 1
|
||||
fi
|
||||
|
||||
- name: Set up latest Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
|
Loading…
Reference in New Issue
Block a user