diff --git a/.github/workflows/linux_x64_docker_ci.yml b/.github/workflows/linux_x64_docker_ci.yml index 984b158..112699b 100644 --- a/.github/workflows/linux_x64_docker_ci.yml +++ b/.github/workflows/linux_x64_docker_ci.yml @@ -59,8 +59,9 @@ jobs: git config --global --add safe.directory "$CLEAN_WORKSPACE" git clone --recursive "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" . - if [ -n "${{ github.event.pull_request.head.sha }}" ]; then - git checkout "${{ github.event.pull_request.head.sha }}" + if [ -n "${{ github.event.number }}" ]; then + git fetch origin "pull/${{ github.event.number }}/head" + git checkout FETCH_HEAD else git checkout "${{ github.sha }}" fi diff --git a/.github/workflows/mac_arm64_ci.yml b/.github/workflows/mac_arm64_ci.yml index 8145ca0..6c5f0e0 100644 --- a/.github/workflows/mac_arm64_ci.yml +++ b/.github/workflows/mac_arm64_ci.yml @@ -62,8 +62,9 @@ jobs: git config --global --add safe.directory "$CLEAN_WORKSPACE" git clone --recursive "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" . - if [ -n "${{ github.event.pull_request.head.sha }}" ]; then - git checkout "${{ github.event.pull_request.head.sha }}" + if [ -n "${{ github.event.number }}" ]; then + git fetch origin "pull/${{ github.event.number }}/head" + git checkout FETCH_HEAD else git checkout "${{ github.sha }}" fi