diff --git a/.github/workflows/verify_library_generation.yaml b/.github/workflows/verify_library_generation.yaml index 8f2520c858..51c276504d 100644 --- a/.github/workflows/verify_library_generation.yaml +++ b/.github/workflows/verify_library_generation.yaml @@ -21,8 +21,10 @@ jobs: shell: bash run: | set -ex - git checkout "${base_ref}" - git checkout "${head_ref}" + git checkout "${base_ref}" # Checkout a detached head, and then fetch the base ref to populate the detached head. + git fetch --no-tags --prune origin +${base_ref}:refs/remotes/origin/${base_ref} + git checkout "${head_ref}" # Checkout a detached head, and then fetch the head ref to populate the detached head. + git fetch --no-tags --prune origin +${head_ref}:refs/remotes/origin/${head_ref} changed_directories="$(git diff --name-only ${base_ref} ${head_ref})" if [[ ${changed_directories} =~ "library_generation/" ]]; then echo "should_run=true" >> $GITHUB_OUTPUT