tekton-pipelines/tasks/git-clone.yaml

23 lines
575 B
YAML

apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: git-clone
namespace: tekton-pipelines
spec:
workspaces:
- name: output
params:
- name: url
type: string
- name: revision
type: string
steps:
- name: clone
image: alpine/git:latest
script: |
#!/bin/sh
# Tekton automatically mounts secrets with tekton.dev/git annotations
# into a shared git credentials file.
git clone $(params.url) $(workspaces.output.path)
cd $(workspaces.output.path)
git checkout $(params.revision)