From f9910caa353797dff45379a0cf23ea9934bad213 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Thu, 5 Dec 2019 10:36:45 -0800 Subject: GitHub Actions: fix typo extracting the branch name Also deal more gracefully with other potential bugs so that we don't add an spurious '-' at the end if the branch is empty for some reason (as that makes the image name invalid). Signed-off-by: Dirk Hohndel --- .github/workflows/mxe-dockerimage-stage2.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/mxe-dockerimage-stage2.yml b/.github/workflows/mxe-dockerimage-stage2.yml index 5e56f68cd..de286703c 100644 --- a/.github/workflows/mxe-dockerimage-stage2.yml +++ b/.github/workflows/mxe-dockerimage-stage2.yml @@ -21,10 +21,10 @@ jobs: run: | v=${{ github.event.action }} s=".stage1" - b=${{ github.event.client_payload.target_branc }} # -BRANCH suffix, unless the branch is master + b=${{ github.event.client_payload.target_branch }} # -BRANCH suffix, unless the branch is master b=${b/refs\/heads\//} b=${b,,} # the name needs to be all lower case - if [ $b = "master" ] ; then b="" ; else b="-$b" ; fi + if [ "$b" = "master" ] || [ "$b" = "" ] ; then b="" ; else b="-$b" ; fi echo "::set-env name=VERSION::${v}${s}" echo "::set-env name=NAME::subsurface/mxe-build-container${b}:${v}" -- cgit v1.2.3-70-g09d2