{
  "name": "git-clone",
  "title": "Shallow-clone a git repository",
  "category": "Git",
  "tags": [
    "git"
  ],
  "version": "1.0.2",
  "date": "2026-10-19",
  "notes": "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.",
  "latest": true,
  "installable": true,
  "url": "https://catalog.dagweave.com/api/v1/items/git-clone/1.0.2.json",
  "templateUrl": "https://catalog.dagweave.com/api/v1/items/git-clone/1.0.2/template.yaml",
  "entrypoint": "clone",
  "parameters": [
    {
      "name": "repo-url",
      "title": "Repository URL",
      "description": "HTTPS clone URL of the repository.",
      "type": "string",
      "required": true
    },
    {
      "name": "depth",
      "title": "Depth",
      "description": "Number of commits to fetch.",
      "type": "string",
      "required": false,
      "default": "1"
    },
    {
      "name": "password-key",
      "title": "Password key",
      "type": "string",
      "required": false,
      "default": "password"
    },
    {
      "name": "path",
      "title": "Destination path",
      "type": "string",
      "required": false,
      "default": "/work"
    },
    {
      "name": "ref",
      "title": "Ref",
      "description": "Branch or tag to clone (a shallow clone requires a named ref).",
      "type": "string",
      "required": false,
      "default": "main"
    },
    {
      "name": "secret-name",
      "title": "Credentials secret name",
      "description": "Kubernetes Secret with the git username/password. Optional for a public repo.",
      "type": "string",
      "required": false,
      "default": "git-credentials"
    },
    {
      "name": "username-key",
      "title": "Username key",
      "type": "string",
      "required": false,
      "default": "username"
    }
  ],
  "images": [
    {
      "ref": "alpine/git@sha256:ac6c828f15d82775d204d3d75112e1d34af8945da80ccf922713c9891ba68e7a",
      "repository": "alpine/git",
      "tag": "2.54.0",
      "digest": "sha256:ac6c828f15d82775d204d3d75112e1d34af8945da80ccf922713c9891ba68e7a"
    }
  ],
  "install": {
    "kubectl": "kubectl apply -n argo -f https://catalog.dagweave.com/api/v1/items/git-clone/1.0.2/template.yaml",
    "argo": "argo template create -n argo https://catalog.dagweave.com/api/v1/items/git-clone/1.0.2/template.yaml"
  },
  "template": "apiVersion: argoproj.io/v1alpha1\nkind: WorkflowTemplate\nmetadata:\n  name: git-clone\n  labels:\n    dagweave.io/catalog-item: git-clone\n  annotations:\n    dagweave.io/catalog-version: \"1.0.2\"\n    dagweave.io/catalog-category: \"Git\"\nspec:\n  entrypoint: clone\n  templates:\n    - name: clone\n      inputs:\n        parameters:\n          - name: repo-url\n          # Branch or tag to clone (shallow clone requires a named ref).\n          - name: ref\n            default: main\n          - name: depth\n            default: \"1\"\n          - name: path\n            default: /work\n          - name: secret-name\n            default: git-credentials\n          - name: username-key\n            default: username\n          - name: password-key\n            default: password\n      container:\n        # alpine/git:2.54.0\n        image: alpine/git@sha256:ac6c828f15d82775d204d3d75112e1d34af8945da80ccf922713c9891ba68e7a\n        command: [sh, -c]\n        # Minimal shallow clone: a single --depth clone of one ref, nothing else.\n        args:\n          - |\n            set -eu\n            if [ -n \"${GIT_USERNAME:-}\" ]; then\n              git config --global credential.helper \\\n                '!f() { echo \"username=${GIT_USERNAME}\"; echo \"password=${GIT_PASSWORD}\"; }; f'\n            fi\n            git clone --depth \"${DEPTH}\" --branch \"${REF}\" \"${REPO_URL}\" \"${DEST}\"\n            git -C \"${DEST}\" log --oneline -1\n        env:\n          - name: REPO_URL\n            value: \"{{inputs.parameters.repo-url}}\"\n          - name: REF\n            value: \"{{inputs.parameters.ref}}\"\n          - name: DEPTH\n            value: \"{{inputs.parameters.depth}}\"\n          - name: DEST\n            value: \"{{inputs.parameters.path}}\"\n          - name: GIT_USERNAME\n            valueFrom:\n              secretKeyRef:\n                name: \"{{inputs.parameters.secret-name}}\"\n                key: \"{{inputs.parameters.username-key}}\"\n                optional: true\n          - name: GIT_PASSWORD\n            valueFrom:\n              secretKeyRef:\n                name: \"{{inputs.parameters.secret-name}}\"\n                key: \"{{inputs.parameters.password-key}}\"\n                optional: true\n",
  "templateSha256": "309a5128cdebbf758c39e8ffbaf5ba261ade2b9ca1f2e021dc324f0bc842112d",
  "source": "https://github.com/dagweave/catalog/tree/67458f74dbbf913b03177f3cefc69424be85eb1d/catalog/git-clone",
  "catalogSha": "67458f74dbbf913b03177f3cefc69424be85eb1d"
}
