Skip to content

[typespec-python regenerate pipeline] Allow TypeSpec regenerate workflow to use fork PR heads - #48164

Closed
Yuchao Yan (msyyc) wants to merge 1 commit into
mainfrom
copilot/enable-typespec-fork-pr-checkout
Closed

[typespec-python regenerate pipeline] Allow TypeSpec regenerate workflow to use fork PR heads#48164
Yuchao Yan (msyyc) wants to merge 1 commit into
mainfrom
copilot/enable-typespec-fork-pr-checkout

Conversation

@msyyc

Copy link
Copy Markdown
Member

Summary

Allow the TypeSpec Python regenerate workflow to resolve a microsoft/typespec PR URL to the PR's actual head repository and SHA, including forked PR branches.

This keeps the accepted input surface limited to https://github.com/microsoft/typespec/pull/<number>, but no longer rejects PRs whose head repository is a fork such as JennyPng/typespec.

Validation

  • Parsed .github/workflows/typespec-python-regenerate.yml as UTF-8 YAML
  • Ran git diff --check -- .github/workflows/typespec-python-regenerate.yml

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
9 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@msyyc Yuchao Yan (msyyc) changed the title Allow TypeSpec regenerate workflow to use fork PR heads [typespec-python regenerate pipeline] Allow TypeSpec regenerate workflow to use fork PR heads Jul 21, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Enables TypeSpec regeneration from fork-backed microsoft/typespec pull requests.

Changes:

  • Resolves the pull request’s head repository and SHA.
  • Adds validation for inaccessible/deleted forks.
  • Includes the fork repository in display output.

echo "::error::Unable to resolve the head repository for microsoft/typespec PR #${PR_NUMBER}. The fork may be deleted or inaccessible."
exit 1
fi
REPO="${HEAD_OWNER}/${HEAD_REPO_NAME}"
@msyyc

Copy link
Copy Markdown
Member Author

For security risk of #48164 (comment), we can't accept this PR

@msyyc
Yuchao Yan (msyyc) deleted the copilot/enable-typespec-fork-pr-checkout branch July 21, 2026 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants