From 9cb72296fc610f8bb1f58027e5430635cefdd5ff Mon Sep 17 00:00:00 2001 From: George McCabe <23407799+georgemccabe@users.noreply.github.com> Date: Thu, 14 Nov 2024 12:06:45 -0700 Subject: [PATCH] fix if --- .github/workflows/trigger_main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/trigger_main.yml b/.github/workflows/trigger_main.yml index 43d7f3d..c29bb22 100644 --- a/.github/workflows/trigger_main.yml +++ b/.github/workflows/trigger_main.yml @@ -42,8 +42,8 @@ jobs: cmd="$GITHUB_WORKSPACE/METplus/metplus/component_versions.py -i METplotpy -v ${version} -o METplus -f main_v{X}.{Y}" echo $cmd metplus_branch=$($cmd) - if !git -C $GITHUB_WORKSPACE/METplus branch -l ${metplus_branch} --format '%(refname:short)'; then - echo "METplus branch ${metplus_branch} does not exist" + if [ -z "$(git -C $GITHUB_WORKSPACE/METplus branch -l ${metplus_branch} --format '%(refname:short)')" ]; then + echo "METplus branch ${metplus_branch} does not exist yet" exit 1 fi echo "metplus_branch=${metplus_branch}" >> $GITHUB_OUTPUT