From 37ba593da4c20bf20c32673778f5035a50c0540b Mon Sep 17 00:00:00 2001 From: qiaofeng1227 <76487013@qq.com> Date: Wed, 5 Jul 2023 11:24:03 +0800 Subject: [PATCH] direct get fork source --- .github/workflows/develop_ci.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/develop_ci.yml b/.github/workflows/develop_ci.yml index 9369fd2a..8bdf6d15 100644 --- a/.github/workflows/develop_ci.yml +++ b/.github/workflows/develop_ci.yml @@ -10,14 +10,15 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v2 + - name: Get pull request number + id: pr + run: echo "::set-output name=number::$(jq --raw-output .pull_request.number $GITHUB_EVENT_PATH)" - - name: Fetch all branches - run: git fetch origin '+refs/pull/*/merge:refs/remotes/origin/pr/*' + - name: Fetch pull request branch + run: git fetch origin pull/${{ steps.pr.outputs.number }}/merge - name: Checkout pull request branch - run: git checkout refs/pull/${{ github.pr_number }}/merge + run: git checkout FETCH_HEAD - name: Test run: |