diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-10-03 20:27:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-03 20:27:24 +0200 |
commit | 43a8f1ae555018b5514af61ed789648afc79a589 (patch) | |
tree | c71cb25fec8abe71da70059f78154dd2ee4e60ad | |
parent | ddf36e06490b5112fd8150f8e5090aa85bfa4018 (diff) | |
parent | 62bc8e3a1813abb21d9bd801862eb2176501b9a8 (diff) | |
download | podman-43a8f1ae555018b5514af61ed789648afc79a589.tar.gz podman-43a8f1ae555018b5514af61ed789648afc79a589.tar.bz2 podman-43a8f1ae555018b5514af61ed789648afc79a589.zip |
Merge pull request #16037 from cevich/fix_branch_go_check
[CI:BUILD] Cirrus: Fix tag & branch go checks failing
-rwxr-xr-x | contrib/cirrus/check_go_changes.sh | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/contrib/cirrus/check_go_changes.sh b/contrib/cirrus/check_go_changes.sh index a92ab03af..aa8f4ccf4 100755 --- a/contrib/cirrus/check_go_changes.sh +++ b/contrib/cirrus/check_go_changes.sh @@ -30,9 +30,17 @@ $(egrep -B 5 -A 5 "$regex"<<<"$diffs")" fi } -if [[ -n "$CIRRUS_TAG" ]] || ! req_env_vars CIRRUS_CHANGE_IN_REPO CIRRUS_PR DEST_BRANCH -then - warn "Skipping: Golang code checks cannot run in this context" +# Defined by Cirrus-CI +# shellcheck disable=SC2154 +if [[ "$CIRRUS_BRANCH" =~ pull ]]; then + for var in CIRRUS_CHANGE_IN_REPO CIRRUS_PR DEST_BRANCH; do + if [[ -z "${!var}" ]]; then + warn "Skipping: Golang code checks require non-empty '\$$var'" + exit 0 + fi + done +else + warn "Skipping: Golang code checks in tag and branch contexts" exit 0 fi |