Skip to content
Draft
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
7 changes: 6 additions & 1 deletion .github/workflows/typespec-python-regenerate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ on:
permissions:
contents: write
issues: write
pull-requests: write
pull-requests: read

# Note: with cancel-in-progress, a newer run can cancel an older one after it
# has force-pushed the branch but before it finishes updating the tracking
Expand Down Expand Up @@ -71,6 +71,11 @@ jobs:
HEAD_SHA=$(echo "$PR_JSON" | jq -r '.headRefOid')
HEAD_OWNER=$(echo "$PR_JSON" | jq -r '.headRepositoryOwner.login')
HEAD_REPO_NAME=$(echo "$PR_JSON" | jq -r '.headRepository.name')
# Reject fork PRs: head branch must be in microsoft/typespec itself
if [ "$HEAD_OWNER/$HEAD_REPO_NAME" != "microsoft/typespec" ]; then
echo "::error::Only PRs with head branches in microsoft/typespec are accepted. Fork PRs are not supported (got ${HEAD_OWNER}/${HEAD_REPO_NAME})."
exit 1
fi
REPO="${HEAD_OWNER}/${HEAD_REPO_NAME}"
REF="${HEAD_SHA}"
DISPLAY_REF="PR #${PR_NUMBER} @ ${HEAD_SHA:0:7}"
Expand Down
Loading