Skip to content

Commit

Permalink
Update task definition from upstream.
Browse files Browse the repository at this point in the history
This fixes a few bugs.

Signed-off-by: Vincent Demeester <[email protected]>
  • Loading branch information
vdemeester committed Aug 30, 2024
1 parent 528ef94 commit e179131
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions task/git-clone/git-clone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,19 @@ spec:
- name: gitInitImage
description: The image providing the git-init binary that this Task runs.
type: string
default: "ghcr.io/tektoncd-catalog/git-clone:v1.0.0"
default: "ghcr.io/tektoncd-catalog/git-clone:v1.0.1"
- name: userHome
description: |
Absolute path to the user's home directory.
type: string
default: "/tekton/home"
default: "/home/git"
results:
- name: commit
description: The precise commit SHA that was fetched by this Task.
- name: url
description: The precise URL that was fetched by this Task.
- name: committer-date
description: The epoch timestamp of the commit that was fetched by this Task.
steps:
- name: clone
image: "$(params.gitInitImage)"
Expand Down Expand Up @@ -174,7 +176,6 @@ spec:
set -x
fi
if [ "${WORKSPACE_BASIC_AUTH_DIRECTORY_BOUND}" = "true" ] ; then
cp "${WORKSPACE_BASIC_AUTH_DIRECTORY_PATH}/.git-credentials" "${PARAM_USER_HOME}/.git-credentials"
cp "${WORKSPACE_BASIC_AUTH_DIRECTORY_PATH}/.gitconfig" "${PARAM_USER_HOME}/.gitconfig"
Expand Down Expand Up @@ -212,13 +213,14 @@ spec:
}
if [ "${PARAM_DELETE_EXISTING}" = "true" ] ; then
cleandir
cleandir || true
fi
test -z "${PARAM_HTTP_PROXY}" || export HTTP_PROXY="${PARAM_HTTP_PROXY}"
test -z "${PARAM_HTTPS_PROXY}" || export HTTPS_PROXY="${PARAM_HTTPS_PROXY}"
test -z "${PARAM_NO_PROXY}" || export NO_PROXY="${PARAM_NO_PROXY}"
git config --global --add safe.directory "${WORKSPACE_OUTPUT_PATH}"
/ko-app/git-init \
-url="${PARAM_URL}" \
-revision="${PARAM_REVISION}" \
Expand All @@ -234,5 +236,7 @@ spec:
if [ "${EXIT_CODE}" != 0 ] ; then
exit "${EXIT_CODE}"
fi
RESULT_COMMITTER_DATE="$(git log -1 --pretty=%ct)"
printf "%s" "${RESULT_COMMITTER_DATE}" > "$(results.committer-date.path)"
printf "%s" "${RESULT_SHA}" > "$(results.commit.path)"
printf "%s" "${PARAM_URL}" > "$(results.url.path)"

0 comments on commit e179131

Please sign in to comment.