File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 44 pull_request_target :
55 types : [opened, reopened, synchronize]
66
7+ permissions :
8+ issues : write
9+
710jobs :
811 check-source-branch :
912 runs-on : ubuntu-latest
1013 timeout-minutes : 10
1114 steps :
1215 - name : Check PR source branch
16+ env :
17+ IS_FORK : ${{ github.event.pull_request.head.repo.fork }}
18+ HEAD_REF : ${{ github.event.pull_request.head.ref }}
1319 run : |
1420 # Check if PR is from a fork
15- if [[ "${{ github.event.pull_request.head.repo.fork }} " == "true" ]]; then
21+ if [[ "$IS_FORK " == "true" ]]; then
1622 # Check if PR is from the master/main branch of a fork
17- if [[ "${{ github.event.pull_request.head.ref }} " == "master" || "${{ github.event.pull_request.head.ref }} " == "main" ]]; then
23+ if [[ "$HEAD_REF " == "master" || "$HEAD_REF " == "main" ]]; then
1824 echo "ERROR: Pull requests from the master/main branch of forks are not allowed, because it prevents maintainers from contributing to your PR"
1925 echo "Please create a feature branch in your fork and submit the PR from that branch instead."
2026 exit 1
You can’t perform that action at this time.
0 commit comments