Shallow-clone a git repository
Shallow-clone a single branch or tag of a git repository to a configurable depth and destination path. Credentials are read from a Kubernetes Secret; leave them blank for a public repo.
Install v1.0.2
Installs the template into your Argo namespace. The URL is pinned to this version.
kubectl apply -n argo -f https://catalog.dagweave.com/api/v1/items/git-clone/1.0.2/template.yaml
Or with the Argo CLI:
argo template create -n argo https://catalog.dagweave.com/api/v1/items/git-clone/1.0.2/template.yaml
Facts
- Category
- Git
- Tags
- git
- Entrypoint
clone- Template SHA-256
309a5128cdebbf758c39e8ffbaf5ba261ade2b9ca1f2e021dc324f0bc842112d- Source
- git-clone at catalog commit 67458f7
- API
- item document, latest template.yaml
Images and provenance
Every image is pinned by digest, so a rebuilt tag can never change what this version runs.
| Repository | Tag | Digest |
|---|---|---|
alpine/git | 2.54.0 | sha256:ac6c828f15d82775d204d3d75112e1d34af8945da80ccf922713c9891ba68e7a |
Parameters
| Name | Description | Default |
|---|---|---|
repo-url required |
HTTPS clone URL of the repository. | none |
depth |
Number of commits to fetch. | 1 |
password-key |
password |
|
path |
/work |
|
ref |
Branch or tag to clone (a shallow clone requires a named ref). | main |
secret-name |
Kubernetes Secret with the git username/password. Optional for a public repo. | git-credentials |
username-key |
username |
WorkflowTemplate
apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata:
name: git-clone
labels:
dagweave.io/catalog-item: git-clone
annotations:
dagweave.io/catalog-version: "1.0.2"
dagweave.io/catalog-category: "Git"
spec:
entrypoint: clone
templates:
- name: clone
inputs:
parameters:
- name: repo-url
# Branch or tag to clone (shallow clone requires a named ref).
- name: ref
default: main
- name: depth
default: "1"
- name: path
default: /work
- name: secret-name
default: git-credentials
- name: username-key
default: username
- name: password-key
default: password
container:
# alpine/git:2.54.0
image: alpine/git@sha256:ac6c828f15d82775d204d3d75112e1d34af8945da80ccf922713c9891ba68e7a
command: [sh, -c]
# Minimal shallow clone: a single --depth clone of one ref, nothing else.
args:
- |
set -eu
if [ -n "${GIT_USERNAME:-}" ]; then
git config --global credential.helper \
'!f() { echo "username=${GIT_USERNAME}"; echo "password=${GIT_PASSWORD}"; }; f'
fi
git clone --depth "${DEPTH}" --branch "${REF}" "${REPO_URL}" "${DEST}"
git -C "${DEST}" log --oneline -1
env:
- name: REPO_URL
value: "{{inputs.parameters.repo-url}}"
- name: REF
value: "{{inputs.parameters.ref}}"
- name: DEPTH
value: "{{inputs.parameters.depth}}"
- name: DEST
value: "{{inputs.parameters.path}}"
- name: GIT_USERNAME
valueFrom:
secretKeyRef:
name: "{{inputs.parameters.secret-name}}"
key: "{{inputs.parameters.username-key}}"
optional: true
- name: GIT_PASSWORD
valueFrom:
secretKeyRef:
name: "{{inputs.parameters.secret-name}}"
key: "{{inputs.parameters.password-key}}"
optional: true
Version history
Read from the item's changelog. Each version has its own JSON document; the pinned catalogue vendors the manifest of the latest one, so that is the version that installs.
-
1.0.2 latest 2026-10-19
Repin alpine/git:2.54.0 on the tag's current digest. What is still open against it is recorded in hack/image-cve-exceptions.txt. Same tool, same arguments; nothing about what the step runs changes.
kubectl apply -n argo -f https://catalog.dagweave.com/api/v1/items/git-clone/1.0.2/template.yamlargo template create -n argo https://catalog.dagweave.com/api/v1/items/git-clone/1.0.2/template.yaml -
1.0.1 2026-08-02
Move alpine/git from 2.45.2 to 2.54.0. Clears all 55 fixable CRITICAL/HIGH; the image now scans clean.
This release is documented, but its manifest is not vendored here, so it has no install command. Version document
-
1.0.0 2026-07-17
Initial release.
This release is documented, but its manifest is not vendored here, so it has no install command. Version document
Run it once
After installing, from the command line.
argo submit -n argo --from workflowtemplate/git-clone \
-p repo-url=...
Workflow that references it
A Workflow with the required parameters filled from the examples.
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: git-clone-
spec:
workflowTemplateRef:
name: git-clone
arguments:
parameters:
- name: repo-url
value: "..."
As a step of a larger workflow
steps:
- - name: git-clone
templateRef:
name: git-clone
template: clone