From b958152d4b9cc39a329984dd0034d1f6c9630836 Mon Sep 17 00:00:00 2001 From: Libba Lawrence Date: Fri, 10 Jul 2026 14:28:19 -0700 Subject: [PATCH] dont need pr read and no fork pr --- .github/workflows/typespec-python-regenerate.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/typespec-python-regenerate.yml b/.github/workflows/typespec-python-regenerate.yml index ab4e5172397b..43d8f2ae01e3 100644 --- a/.github/workflows/typespec-python-regenerate.yml +++ b/.github/workflows/typespec-python-regenerate.yml @@ -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 @@ -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}"