From c12715e11f3a66ef9df43fff40e2231a9fa60003 Mon Sep 17 00:00:00 2001 From: Lucas Schwiderski Date: Sun, 19 Sep 2021 14:51:49 +0200 Subject: [PATCH] bug(github_actions): Skip testing single previous commit Due to the default of executing bash with `-e -o pipefail` this didn't fail gracefully anymore. But an explicit check makes more sense anyways. --- .github/workflows/main.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a3b46962..1194f74d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -343,6 +343,12 @@ jobs: git fetch --unshallow --all rev_list="$(git rev-list --bisect-all origin/${{ github.base_ref }}..fork/${{ github.head_ref }})" + # The most recent commit has already been tested. So if that's the + # only commit in the PR, we can stop here. + if [[ $(echo "$rev_list" | wc -l) -lt 2 ]]; then + exit 0 + fi + commits="$(echo "$rev_list" | grep -v 'dist=0' | cut -d' ' -f 1)" n="$(echo "$commits" | wc -l)"