From 949ce40eec94cf0d2aa3e0c47d8d4c768c86e138 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Wed, 2 Mar 2022 14:14:54 -0800 Subject: [PATCH 1/2] all: fix ci ref_protected check for caching --- .github/actions/setup-go/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup-go/action.yml b/.github/actions/setup-go/action.yml index eab39828bf..e7e164b95b 100644 --- a/.github/actions/setup-go/action.yml +++ b/.github/actions/setup-go/action.yml @@ -42,7 +42,7 @@ runs: # rebuilds and cause test runs to skip tests that have no reason to rerun. # Don't run this for protected branches like master/main. - uses: actions/cache@v2 - if: github.ref_protected || github.ref != 'refs/heads/master' + if: (!github.ref_protected) || github.ref != 'refs/heads/master' || github.ref != 'refs/heads/main' with: path: ~/.cache/go-build key: ${{ env.PREFIX }}-go-build-${{ github.ref }}-${{ hashFiles('**', '!.git') }} From cdd7ebe38614dd30ce03f8385770eeb8081e5dcf Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Wed, 2 Mar 2022 14:18:25 -0800 Subject: [PATCH 2/2] Update action.yml --- .github/actions/setup-go/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup-go/action.yml b/.github/actions/setup-go/action.yml index e7e164b95b..703964f6c3 100644 --- a/.github/actions/setup-go/action.yml +++ b/.github/actions/setup-go/action.yml @@ -42,7 +42,7 @@ runs: # rebuilds and cause test runs to skip tests that have no reason to rerun. # Don't run this for protected branches like master/main. - uses: actions/cache@v2 - if: (!github.ref_protected) || github.ref != 'refs/heads/master' || github.ref != 'refs/heads/main' + if: (!github.ref_protected) && github.ref != 'refs/heads/master' && github.ref != 'refs/heads/main' with: path: ~/.cache/go-build key: ${{ env.PREFIX }}-go-build-${{ github.ref }}-${{ hashFiles('**', '!.git') }}