From 20a2f46e6c40706a6ad7fff2f46130b9890a48f8 Mon Sep 17 00:00:00 2001 From: Anna Rift Date: Mon, 16 Dec 2024 13:47:58 -0800 Subject: [PATCH] asdf Signed-off-by: Anna Rift --- .github/workflows/CI.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 77e037f77858..2928ee699c32 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -153,14 +153,15 @@ jobs: baseSHA=${{github.event.pull_request.base.sha}} headSHA=${{github.event.pull_request.head.sha}} + echo "Base SHA: $baseSHA" + echo "Head SHA: $headSHA" + echo "${{github.event.pull_request.commits}} commits in PR" + # Loop backward through commits added in the PR, starting from the # latest. + commitIdx=0 for commit in $(git rev-list $baseSHA..$headSHA) do - if [ "$commit" = "$baseSHA" ]; then - break - fi - echo "Checking commit: $commit" git checkout -q $commit @@ -180,4 +181,11 @@ jobs: exit 1 fi done <<< "$newFiles" + + # Stop after going through the number of commits this PR has. + commitIdx=$((commitIdx+1)) + if [ "$commitIdx" = "${{github.event.pull_request.commits}}" ]; then + echo "Stopping after $commitIdx commits, on commit $commit" + break + fi done