bug fixed
This commit is contained in:
parent
f7f7c98608
commit
d9d817fed2
@ -54,8 +54,7 @@ spec:
|
|||||||
description: |
|
description: |
|
||||||
The base image for the task.
|
The base image for the task.
|
||||||
type: string
|
type: string
|
||||||
# TODO: Deprecate use of root image.
|
default: alpine/git:2.47.2
|
||||||
default: cgr.dev/chainguard/git:root-2.39@sha256:7759f87050dd8bacabe61354d75ccd7f864d6b6f8ec42697db7159eccd491139
|
|
||||||
|
|
||||||
- name: GIT_USER_NAME
|
- name: GIT_USER_NAME
|
||||||
type: string
|
type: string
|
||||||
@ -102,14 +101,6 @@ spec:
|
|||||||
value: $(params.VERBOSE)
|
value: $(params.VERBOSE)
|
||||||
- name: PARAM_USER_HOME
|
- name: PARAM_USER_HOME
|
||||||
value: $(params.USER_HOME)
|
value: $(params.USER_HOME)
|
||||||
- name: WORKSPACE_SSH_DIRECTORY_BOUND
|
|
||||||
value: $(workspaces.ssh-directory.bound)
|
|
||||||
- name: WORKSPACE_SSH_DIRECTORY_PATH
|
|
||||||
value: $(workspaces.ssh-directory.path)
|
|
||||||
- name: WORKSPACE_BASIC_AUTH_DIRECTORY_BOUND
|
|
||||||
value: $(workspaces.basic-auth.bound)
|
|
||||||
- name: WORKSPACE_BASIC_AUTH_DIRECTORY_PATH
|
|
||||||
value: $(workspaces.basic-auth.path)
|
|
||||||
script: |
|
script: |
|
||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
set -eu
|
set -eu
|
||||||
@ -118,22 +109,25 @@ spec:
|
|||||||
set -x
|
set -x
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${WORKSPACE_BASIC_AUTH_DIRECTORY_BOUND}" = "true" ] ; then
|
if [ -f "$(workspaces.basic-auth.path)/.git-credentials" ]; then
|
||||||
cp "${WORKSPACE_BASIC_AUTH_DIRECTORY_PATH}/.git-credentials" "${PARAM_USER_HOME}/.git-credentials"
|
cp "$(workspaces.basic-auth.path)/.git-credentials" "${PARAM_USER_HOME}/.git-credentials"
|
||||||
cp "${WORKSPACE_BASIC_AUTH_DIRECTORY_PATH}/.gitconfig" "${PARAM_USER_HOME}/.gitconfig"
|
cp "$(workspaces.basic-auth.path)/.gitconfig" "${PARAM_USER_HOME}/.gitconfig"
|
||||||
chmod 400 "${PARAM_USER_HOME}/.git-credentials"
|
chmod 400 "${PARAM_USER_HOME}/.git-credentials"
|
||||||
chmod 400 "${PARAM_USER_HOME}/.gitconfig"
|
chmod 400 "${PARAM_USER_HOME}/.gitconfig"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${WORKSPACE_SSH_DIRECTORY_BOUND}" = "true" ] ; then
|
if [ -f "$(workspaces.ssh-directory.path)" ]; then
|
||||||
cp -R "${WORKSPACE_SSH_DIRECTORY_PATH}" "${PARAM_USER_HOME}"/.ssh
|
cp -R "$(workspaces.ssh-directory.path)" "${PARAM_USER_HOME}/.ssh"
|
||||||
chmod 700 "${PARAM_USER_HOME}"/.ssh
|
chmod 700 "${PARAM_USER_HOME}/.ssh"
|
||||||
chmod -R 400 "${PARAM_USER_HOME}"/.ssh/*
|
chmod -R 400 "${PARAM_USER_HOME}/.ssh/*"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Setting up the config for the git.
|
if [ -f "$(params.GIT_USER_EMAIL)" ]; then
|
||||||
git config --global user.email "$(params.GIT_USER_EMAIL)"
|
git config --global user.email "$(params.GIT_USER_EMAIL)"
|
||||||
git config --global user.name "$(params.GIT_USER_NAME)"
|
fi
|
||||||
|
if [ -f "$(params.GIT_USER_NAME)" ]; then
|
||||||
|
git config --global user.name "$(params.GIT_USER_NAME)"
|
||||||
|
fi
|
||||||
|
|
||||||
eval '$(params.GIT_SCRIPT)'
|
eval '$(params.GIT_SCRIPT)'
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user