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 9809cf11dd..50e2c8daf1 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="$(git rev-parse --short=$(params.shortCommitLength) HEAD)" + RESULT_SHA_SHORT="$(git 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 b7bbbe0b28..85e874f336 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="$(git rev-parse --short=$(params.shortCommitLength) HEAD)" + RESULT_SHA_SHORT="$(git rev-parse --short="${PARAM_SHORT_COMMIT_LENGTH}" HEAD)" EXIT_CODE="$?" if [ "${EXIT_CODE}" != 0 ] ; then exit "${EXIT_CODE}"