Check out a git repository
Clone a git repository and check out a branch, tag, or commit into a path. Credentials (username/password, e.g. a personal access token) are read from a Kubernetes Secret; leave them blank for a public repo. Converted from the built-in dagweave "Check out a git repository" blueprint.
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-checkout/1.0.2/template.yaml
Or with the Argo CLI:
argo template create -n argo https://catalog.dagweave.com/api/v1/items/git-checkout/1.0.2/template.yaml
Facts
- Category
- Git
- Tags
- git
- Entrypoint
checkout- Template SHA-256
5ef20b532f2cd171074f221a994fbd46a83f107a3a603b3c742308d9733cd8ed- Source
- git-checkout 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. Example https://github.com/octocat/hello-world.git |
none |
password-key |
Key within the Secret holding the git password or token. | password |
path |
Directory to clone into. | /work |
revision |
Branch, tag, or commit SHA to check out. | main |
secret-name |
Kubernetes Secret with the git username/password. Optional for a public repo. | git-credentials |
username-key |
Key within the Secret holding the git username. | username |
WorkflowTemplate
apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata:
name: git-checkout
labels:
dagweave.io/catalog-item: git-checkout
annotations:
# The catalog semver this manifest was authored at. Keep in sync with
# metadata.yaml `version`.
dagweave.io/catalog-version: "1.0.2"
dagweave.io/catalog-category: "Git"
spec:
entrypoint: checkout
templates:
- name: checkout
inputs:
parameters:
# HTTPS clone URL of the repository.
- name: repo-url
# Branch, tag, or commit SHA to check out.
- name: revision
default: main
# Directory to clone into.
- name: path
default: /work
# Name of the Kubernetes Secret holding git credentials. For a public
# repo the Secret may be absent (the credential env is optional).
- name: secret-name
default: git-credentials
- name: username-key
default: username
- name: password-key
default: password
container:
# Pinned by digest per the catalog convention: an image rebuild can never
# silently change the behaviour of an already-released item version.
# alpine/git:2.54.0
image: alpine/git@sha256:ac6c828f15d82775d204d3d75112e1d34af8945da80ccf922713c9891ba68e7a
command: [sh, -c]
# Reproduces the old dagweave "Check out a git repository" blueprint: clone a repo at a
# revision. Credentials (username/password, e.g. a PAT as the password)
# come from a Secret via env; a blank username means an anonymous clone.
args:
- |
set -eu
if [ -n "${GIT_USERNAME:-}" ]; then
git config --global credential.helper \
'!f() { echo "username=${GIT_USERNAME}"; echo "password=${GIT_PASSWORD}"; }; f'
fi
mkdir -p "${DEST}"
git clone "${REPO_URL}" "${DEST}"
git -C "${DEST}" checkout "${REVISION}"
git -C "${DEST}" log --oneline -1
env:
- name: REPO_URL
value: "{{inputs.parameters.repo-url}}"
- name: REVISION
value: "{{inputs.parameters.revision}}"
- 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-checkout/1.0.2/template.yamlargo template create -n argo https://catalog.dagweave.com/api/v1/items/git-checkout/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. Converted from the built-in git-checkout blueprint.
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-checkout \
-p repo-url=https://github.com/octocat/hello-world.git
Workflow that references it
A Workflow with the required parameters filled from the examples.
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: git-checkout-
spec:
workflowTemplateRef:
name: git-checkout
arguments:
parameters:
- name: repo-url
value: "https://github.com/octocat/hello-world.git"
As a step of a larger workflow
steps:
- - name: git-checkout
templateRef:
name: git-checkout
template: checkout