From 4add6641534050854720a23eb85e7d4bbd137308 Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Thu, 22 Jul 2021 11:44:34 -0600 Subject: [PATCH] Deal with pr null in not preprending build name (#363) Where there is not an active PR, the 'pull_number' comes back 'null'. In this case, we don't want to append the build name. --- cmake/ctest/github_actions/run_github_actions_ctest_driver.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake/ctest/github_actions/run_github_actions_ctest_driver.sh b/cmake/ctest/github_actions/run_github_actions_ctest_driver.sh index 376985e32..a1a51ae51 100755 --- a/cmake/ctest/github_actions/run_github_actions_ctest_driver.sh +++ b/cmake/ctest/github_actions/run_github_actions_ctest_driver.sh @@ -171,7 +171,9 @@ echo "CTEST_BUILD_NAME = '${CTEST_BUILD_NAME}'" if [[ "${GITHUB_EVENT_PATH}" != "" ]] ; then pull_number=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH") echo "pull_number = '${pull_number}'" - export CTEST_BUILD_NAME="pr-${pull_number}_${CTEST_BUILD_NAME}${CTEST_BUILD_NAME_SUFFIX}" + if [[ "${pull_number}" != "null" ]] ; then + export CTEST_BUILD_NAME="pr-${pull_number}_${CTEST_BUILD_NAME}${CTEST_BUILD_NAME_SUFFIX}" + fi fi echo "CTEST_BUILD_NAME = '${CTEST_BUILD_NAME}'"