Skip to main content

Git Clone

This source component lets Smithy clone a repository from GitHub, GitLab or BitBucket.

How to use

Open-Source

  1. Add the Helm package to the pipeline settings:
---
# file: ./my-pipeline/kustomization.yaml
kind: Kustomization
components:
- pkg:helm/smithy-security-oss-components/git-clone
  1. Configure the run parameters of the component in the pipeline run file:
# file: ./my-pipeline/pipelinerun.yaml
---
...
spec:
pipelineRef:
name: go-pipeline
params:
- name: git-clone-url
value: <Your Git URL>

SaaS

  1. In the Smithy UI, open the page to create a new workflow.
  2. Find the Git Clone in the Sources dropdown.
  3. Set the URL of your repository on the right. If your repository is private, read below.

All other settings are optional.

Cloning a private repository

If you are cloning a private repo, the URL should include your PAT token:

https://<pat>@github.com/<your account or organization>/<repo>.git

You can generate a PAT token on GitHub via your account settings. Read the precise instructions here.

Options

You can configure this component with the following options. The options that have a default value are optional:

Option NameDescriptionDefaultType
[Required] git-clone-urlRepository URL to cloneString
git-clone-revisionRevision to checkout. (a branch, tag, sha, ref, etc...)String
git-clone-refspecRefspec to fetch before checking out revision.String
git-clone-submodulesInitialize and fetch git submodules."true"Boolean
git-clone-depthPerform a shallow clone, fetching only the most recent N commits."1"Number
git-clone-sslVerifySet the http.sslVerify global git config. Setting this to false is not advised unless you are sure that you trust your git remote."true"Boolean
git-clone-crtFileNameFile name of mounted CRT using ssl-ca-directory workspace."ca-bundle.crt"String
git-clone-subdirectorySubdirectory inside the output Workspace to clone the repo into."source-code"String
git-clone-sparseCheckoutDirectoriesDefine the directory patterns to match or exclude when performing a sparse checkout.String
git-clone-deleteExistingClean out the contents of the destination directory if it already exists before cloning."true"Boolean
git-clone-httpProxyHTTP proxy server for non-SSL requests.String
git-clone-httpsProxyHTTPS proxy server for SSL requests.String
git-clone-noProxyOpt out of proxying HTTP/HTTPS requests.String
git-clone-verboseLog the commands that are executed during git-clone's operation."true"Boolean
git-clone-gitInitImageThe image providing the git-init binary that this Task runs."gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/git-init:v0.40.2"String
git-clone-userHomeAbsolute path to the user's home directory."/home/git"String