From a0c39aa9dbd8df018fb7b88c1d530ccf9e3b0861 Mon Sep 17 00:00:00 2001 From: Eti Zaguri Date: Tue, 30 Apr 2024 12:01:21 +0300 Subject: [PATCH] Cr 23090 (#693) * add encoding to git access token * add encoding to git access token * codefreshplugins/git-commit:0.1.4 * upgarde to ubuntu:jammy --- incubating/git-commit/Dockerfile | 6 +++--- incubating/git-commit/step.yaml | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/incubating/git-commit/Dockerfile b/incubating/git-commit/Dockerfile index eb92f825d..aab6f5f0e 100644 --- a/incubating/git-commit/Dockerfile +++ b/incubating/git-commit/Dockerfile @@ -1,9 +1,9 @@ -# Moving to ubuntu instead of debian to solve high vulnerabilities -FROM ubuntu:jammy-20221101 +# Moving to ubuntu instead of debian to solve high vulnerabilities +FROM ubuntu:jammy RUN apt-get update -y && \ apt-get upgrade -y && \ - apt-get install git bash openssl busybox -y && \ + apt-get install git bash openssl busybox jq -y && \ ln -s /bin/busybox /usr/bin/[[ # Add ssh record on which ssh key to use diff --git a/incubating/git-commit/step.yaml b/incubating/git-commit/step.yaml index 428b60391..4ded9a1b7 100644 --- a/incubating/git-commit/step.yaml +++ b/incubating/git-commit/step.yaml @@ -2,7 +2,7 @@ kind: step-type version: '1.0' metadata: name: git-commit - version: 0.1.3 + version: 0.1.4 isPublic: true description: Commit and push changes to repository icon: @@ -165,7 +165,7 @@ spec: commit_and_push: title: "Commit and push" - image: codefreshplugins/git-commit:0.1.3 + image: codefreshplugins/git-commit:0.1.4 shell: bash environment: - REPO=${{repo}} @@ -198,7 +198,8 @@ spec: - git commit ${ALLOW_EMPTY} -m "${COMMIT_MESSAGE}" - git status - |- - REPO_URL="https://$GIT_ACCESS_TOKEN_USER:$GIT_ACCESS_TOKEN@$GIT_FQDN/$REPO.git" + ENCODED_GIT_ACCESS_TOKEN=$(echo -n "${GIT_ACCESS_TOKEN}" | jq -sRr @uri) + REPO_URL="https://$GIT_ACCESS_TOKEN_USER:$ENCODED_GIT_ACCESS_TOKEN@$GIT_FQDN/$REPO.git" if [ "$USE_SSH" = "true" ]; then [ -z "$PRIVATE_KEY" ] && (echo "missing PRIVATE_KEY var" | tee /dev/stderr) && exit 1 echo ${PRIVATE_KEY:1:-1} | sed 's/\\n/\n/g' > ~/.ssh/codefresh