From 9cfbaf92e5bc80dca90f1226dbc4cdcfe025eeb3 Mon Sep 17 00:00:00 2001 From: Delan Azabani Date: Mon, 9 Sep 2024 12:43:25 +0800 Subject: CI: fix self-hosted runners in try-label builds (#33373) Signed-off-by: Delan Azabani --- .github/workflows/linux.yml | 2 +- .github/workflows/windows.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index ae7548e3112..3eabd978768 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -108,7 +108,7 @@ jobs: - if: ${{ fromJSON(needs.runner-select.outputs.is-self-hosted) && github.event_name != 'pull_request_target' }} run: git fetch --depth=1 origin $env:GITHUB_SHA - if: ${{ fromJSON(needs.runner-select.outputs.is-self-hosted) && github.event_name == 'pull_request_target' }} - run: git fetch --depth=1 origin refs/pull/${{ github.event_number }}/head + run: git fetch --depth=1 origin ${{ github.event.pull_request.head.sha }} - if: ${{ fromJSON(needs.runner-select.outputs.is-self-hosted) }} # Same as `git switch --detach FETCH_HEAD`, but fixes up dirty working # trees, in case the runner image was baked with a dirty working tree. diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index e2d706d514f..d4b6698eb56 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -81,7 +81,7 @@ jobs: - if: ${{ fromJSON(needs.runner-select.outputs.is-self-hosted) && github.event_name != 'pull_request_target' }} run: git fetch --depth=1 origin $env:GITHUB_SHA - if: ${{ fromJSON(needs.runner-select.outputs.is-self-hosted) && github.event_name == 'pull_request_target' }} - run: git fetch --depth=1 origin refs/pull/${{ github.event_number }}/head + run: git fetch --depth=1 origin ${{ github.event.pull_request.head.sha }} - if: ${{ fromJSON(needs.runner-select.outputs.is-self-hosted) }} # Same as `git switch --detach FETCH_HEAD`, but fixes up dirty working # trees, in case the runner image was baked with a dirty working tree. -- cgit v1.2.3