{
  "name": "git-checkout",
  "title": "Check out 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-checkout/1.0.2.json",
  "templateUrl": "https://catalog.dagweave.com/api/v1/items/git-checkout/1.0.2/template.yaml",
  "entrypoint": "checkout",
  "parameters": [
    {
      "name": "repo-url",
      "title": "Repository URL",
      "description": "HTTPS clone URL of the repository.",
      "type": "string",
      "required": true,
      "example": "https://github.com/octocat/hello-world.git"
    },
    {
      "name": "password-key",
      "title": "Password key",
      "description": "Key within the Secret holding the git password or token.",
      "type": "string",
      "required": false,
      "default": "password"
    },
    {
      "name": "path",
      "title": "Destination path",
      "description": "Directory to clone into.",
      "type": "string",
      "required": false,
      "default": "/work"
    },
    {
      "name": "revision",
      "title": "Revision",
      "description": "Branch, tag, or commit SHA to check out.",
      "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",
      "description": "Key within the Secret holding the git username.",
      "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-checkout/1.0.2/template.yaml",
    "argo": "argo template create -n argo https://catalog.dagweave.com/api/v1/items/git-checkout/1.0.2/template.yaml"
  },
  "template": "apiVersion: argoproj.io/v1alpha1\nkind: WorkflowTemplate\nmetadata:\n  name: git-checkout\n  labels:\n    dagweave.io/catalog-item: git-checkout\n  annotations:\n    # The catalog semver this manifest was authored at. Keep in sync with\n    # metadata.yaml `version`.\n    dagweave.io/catalog-version: \"1.0.2\"\n    dagweave.io/catalog-category: \"Git\"\nspec:\n  entrypoint: checkout\n  templates:\n    - name: checkout\n      inputs:\n        parameters:\n          # HTTPS clone URL of the repository.\n          - name: repo-url\n          # Branch, tag, or commit SHA to check out.\n          - name: revision\n            default: main\n          # Directory to clone into.\n          - name: path\n            default: /work\n          # Name of the Kubernetes Secret holding git credentials. For a public\n          # repo the Secret may be absent (the credential env is optional).\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        # Pinned by digest per the catalog convention: an image rebuild can never\n        # silently change the behaviour of an already-released item version.\n        # alpine/git:2.54.0\n        image: alpine/git@sha256:ac6c828f15d82775d204d3d75112e1d34af8945da80ccf922713c9891ba68e7a\n        command: [sh, -c]\n        # Reproduces the old dagweave \"Check out a git repository\" blueprint: clone a repo at a\n        # revision. Credentials (username/password, e.g. a PAT as the password)\n        # come from a Secret via env; a blank username means an anonymous clone.\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            mkdir -p \"${DEST}\"\n            git clone \"${REPO_URL}\" \"${DEST}\"\n            git -C \"${DEST}\" checkout \"${REVISION}\"\n            git -C \"${DEST}\" log --oneline -1\n        env:\n          - name: REPO_URL\n            value: \"{{inputs.parameters.repo-url}}\"\n          - name: REVISION\n            value: \"{{inputs.parameters.revision}}\"\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": "5ef20b532f2cd171074f221a994fbd46a83f107a3a603b3c742308d9733cd8ed",
  "source": "https://github.com/dagweave/catalog/tree/67458f74dbbf913b03177f3cefc69424be85eb1d/catalog/git-checkout",
  "catalogSha": "67458f74dbbf913b03177f3cefc69424be85eb1d"
}
