File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020permissions :
2121 contents : write
2222 issues : write
23- pull-requests : write
23+ pull-requests : read
2424
2525# Note: with cancel-in-progress, a newer run can cancel an older one after it
2626# has force-pushed the branch but before it finishes updating the tracking
7171 HEAD_SHA=$(echo "$PR_JSON" | jq -r '.headRefOid')
7272 HEAD_OWNER=$(echo "$PR_JSON" | jq -r '.headRepositoryOwner.login')
7373 HEAD_REPO_NAME=$(echo "$PR_JSON" | jq -r '.headRepository.name')
74+ # Reject fork PRs: head branch must be in microsoft/typespec itself
75+ if [ "$HEAD_OWNER/$HEAD_REPO_NAME" != "microsoft/typespec" ]; then
76+ echo "::error::Only PRs with head branches in microsoft/typespec are accepted. Fork PRs are not supported (got ${HEAD_OWNER}/${HEAD_REPO_NAME})."
77+ exit 1
78+ fi
7479 REPO="${HEAD_OWNER}/${HEAD_REPO_NAME}"
7580 REF="${HEAD_SHA}"
7681 DISPLAY_REF="PR #${PR_NUMBER} @ ${HEAD_SHA:0:7}"
You can’t perform that action at this time.
0 commit comments