From f116b3a51ba182be67843cdd8e307aa5a91db694 Mon Sep 17 00:00:00 2001 From: Kangyan-Zhou Date: Thu, 12 Feb 2026 21:05:17 +0800 Subject: [PATCH] Make PR based docker and pypi workflow work for forked PR (#18720) --- .github/workflows/release-docker-dev-pr.yml | 8 ++------ .github/workflows/release-pypi-pr.yml | 8 ++------ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/.github/workflows/release-docker-dev-pr.yml b/.github/workflows/release-docker-dev-pr.yml index 08323008c..ed79d005f 100644 --- a/.github/workflows/release-docker-dev-pr.yml +++ b/.github/workflows/release-docker-dev-pr.yml @@ -4,11 +4,7 @@ on: workflow_dispatch: inputs: pr_number: - description: 'PR number to build from' - required: true - type: string - pr_branch: - description: 'PR branch name to build from (e.g., my-feature-branch or refs/pull/123/head)' + description: 'PR number to build from (works with both internal and fork PRs)' required: true type: string @@ -43,7 +39,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 with: - ref: ${{ inputs.pr_branch }} + ref: refs/pull/${{ inputs.pr_number }}/head - name: Free disk space uses: jlumbroso/free-disk-space@main diff --git a/.github/workflows/release-pypi-pr.yml b/.github/workflows/release-pypi-pr.yml index deff4665c..93d704736 100644 --- a/.github/workflows/release-pypi-pr.yml +++ b/.github/workflows/release-pypi-pr.yml @@ -4,11 +4,7 @@ on: workflow_dispatch: inputs: pr_number: - description: 'PR number to build wheel for' - required: true - type: string - pr_branch: - description: 'PR branch name to build from (e.g., my-feature-branch or refs/pull/123/head)' + description: 'PR number to build wheel for (works with both internal and fork PRs)' required: true type: string @@ -27,7 +23,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - ref: ${{ inputs.pr_branch }} + ref: refs/pull/${{ inputs.pr_number }}/head fetch-depth: 0 # Need full history for version generation - name: Set up Python