Skip to content

Commit a0c39aa

Browse files
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
1 parent 1b98a3a commit a0c39aa

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

incubating/git-commit/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# Moving to ubuntu instead of debian to solve high vulnerabilities
2-
FROM ubuntu:jammy-20221101
1+
# Moving to ubuntu instead of debian to solve high vulnerabilities
2+
FROM ubuntu:jammy
33

44
RUN apt-get update -y && \
55
apt-get upgrade -y && \
6-
apt-get install git bash openssl busybox -y && \
6+
apt-get install git bash openssl busybox jq -y && \
77
ln -s /bin/busybox /usr/bin/[[
88

99
# Add ssh record on which ssh key to use

incubating/git-commit/step.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ kind: step-type
22
version: '1.0'
33
metadata:
44
name: git-commit
5-
version: 0.1.3
5+
version: 0.1.4
66
isPublic: true
77
description: Commit and push changes to repository
88
icon:
@@ -165,7 +165,7 @@ spec:
165165

166166
commit_and_push:
167167
title: "Commit and push"
168-
image: codefreshplugins/git-commit:0.1.3
168+
image: codefreshplugins/git-commit:0.1.4
169169
shell: bash
170170
environment:
171171
- REPO=${{repo}}
@@ -198,7 +198,8 @@ spec:
198198
- git commit ${ALLOW_EMPTY} -m "${COMMIT_MESSAGE}"
199199
- git status
200200
- |-
201-
REPO_URL="https://$GIT_ACCESS_TOKEN_USER:$GIT_ACCESS_TOKEN@$GIT_FQDN/$REPO.git"
201+
ENCODED_GIT_ACCESS_TOKEN=$(echo -n "${GIT_ACCESS_TOKEN}" | jq -sRr @uri)
202+
REPO_URL="https://$GIT_ACCESS_TOKEN_USER:$ENCODED_GIT_ACCESS_TOKEN@$GIT_FQDN/$REPO.git"
202203
if [ "$USE_SSH" = "true" ]; then
203204
[ -z "$PRIVATE_KEY" ] && (echo "missing PRIVATE_KEY var" | tee /dev/stderr) && exit 1
204205
echo ${PRIVATE_KEY:1:-1} | sed 's/\\n/\n/g' > ~/.ssh/codefresh

0 commit comments

Comments
 (0)