GitClone is a builtin action, you can’t modify it.
Clone a repository into a new directory.
{{.git.tag}}
to clone a tag from your repository. In this way, in your workflow payload you can add a key in your JSON like “git.tag”: “1.0.2”.Example of a pipeline using GitClone action:
version: v1.0
name: Pipeline1
stages:
- Stage1
jobs:
- job: Job1
stage: Stage1
steps:
- gitClone:
branch: '{{.git.branch}}'
commit: '{{.git.commit}}'
directory: '{{.cds.workspace}}'
privateKey: proj-mykey
url: '{{.git.url}}'
By default, depth is 50 and git clone with --single-branch
automatically.
So, if you want to do in a step script git diff anotherBranch
, you have to set depth to ‘false’.
If there is no user && password && sshkey set in action GitClone, CDS checks on Application VCS Strategy if some auth parameters can be used.