From f24e7b721af338094dc2ced17d9fbcf0da4934a6 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Thu, 17 Sep 2020 21:51:49 +0530 Subject: [PATCH] cerbero ci: Don't expand the ssh private key Because of set -x we were printing the key into the CI logs: https://gitlab.freedesktop.org/gstreamer/cerbero/-/jobs/4572836#L797 Don't ever expand the variable in shell. --- gitlab/cerbero_setup.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gitlab/cerbero_setup.sh b/gitlab/cerbero_setup.sh index c4e52513dd..48a8a2857a 100644 --- a/gitlab/cerbero_setup.sh +++ b/gitlab/cerbero_setup.sh @@ -107,7 +107,10 @@ cerbero_deps_script() { rsync -aH "${CERBERO_OVERRIDDEN_DIST_DIR}/" "${CERBERO_HOME}/dist/${ARCH}" fi - if [[ -n ${CERBERO_PRIVATE_SSH_KEY} ]]; then + # Check that the env var is set. Don't expand this protected variable by + # doing something silly like [[ -n ${CERBERO_...} ]] because it will get + # printed in the CI logs due to set -x + if env | grep -q -e CERBERO_PRIVATE_SSH_KEY; then $CERBERO $CERBERO_ARGS gen-cache --branch "${GST_UPSTREAM_BRANCH}" $CERBERO $CERBERO_ARGS upload-cache --branch "${GST_UPSTREAM_BRANCH}" fi