diff --git a/task/git-clone-oci-ta/0.1/git-clone-oci-ta.yaml b/task/git-clone-oci-ta/0.1/git-clone-oci-ta.yaml index ba075d0e22..d233cfbbe9 100644 --- a/task/git-clone-oci-ta/0.1/git-clone-oci-ta.yaml +++ b/task/git-clone-oci-ta/0.1/git-clone-oci-ta.yaml @@ -159,6 +159,8 @@ spec: value: $(params.submodules) - name: PARAM_DEPTH value: $(params.depth) + - name: PARAM_SHORT_COMMIT_LENGTH + value: $(params.shortCommitLength) - name: PARAM_SSL_VERIFY value: $(params.sslVerify) - name: PARAM_HTTP_PROXY @@ -238,7 +240,7 @@ spec: -sparseCheckoutDirectories="${PARAM_SPARSE_CHECKOUT_DIRECTORIES}" cd "${CHECKOUT_DIR}" RESULT_SHA="$(git rev-parse HEAD)" - RESULT_SHA_SHORT="$(get rev-parse --short=$(params.shortCommitLength) HEAD)" + RESULT_SHA_SHORT="$(get rev-parse --short="${PARAM_SHORT_COMMIT_LENGTH}" HEAD)" EXIT_CODE="$?" if [ "${EXIT_CODE}" != 0 ]; then exit "${EXIT_CODE}" diff --git a/task/git-clone/0.1/git-clone.yaml b/task/git-clone/0.1/git-clone.yaml index 346d18d84e..8948d7fd28 100644 --- a/task/git-clone/0.1/git-clone.yaml +++ b/task/git-clone/0.1/git-clone.yaml @@ -119,6 +119,8 @@ spec: value: $(params.submodules) - name: PARAM_DEPTH value: $(params.depth) + - name: PARAM_SHORT_COMMIT_LENGTH + value: $(params.shortCommitLength) - name: PARAM_SSL_VERIFY value: $(params.sslVerify) - name: PARAM_SUBDIRECTORY @@ -237,7 +239,7 @@ spec: -sparseCheckoutDirectories="${PARAM_SPARSE_CHECKOUT_DIRECTORIES}" cd "${CHECKOUT_DIR}" RESULT_SHA="$(git rev-parse HEAD)" - RESULT_SHA_SHORT="$(get rev-parse --short=$(params.shortCommitLength) HEAD)" + RESULT_SHA_SHORT="$(get rev-parse --short="${PARAM_SHORT_COMMIT_LENGTH}" HEAD)" EXIT_CODE="$?" if [ "${EXIT_CODE}" != 0 ] ; then exit "${EXIT_CODE}"