Use this action to check out a Git repository under $CLOUDBEES_WORKSPACE
, to allow your workflow to access the repository.
Your authentication for the checked-out repository is persisted in the local Git config file by default, so your scripts can run authenticated Git commands in any container image that has Git executables.
The CloudBees API token is used to fetch an app access token if neither the PAT nor an SSH key are provided.
All CloudBees action repositories are listed at CloudBees, Inc. on GitHub. |
Inputs
Input name | Data type | Required? | Description |
---|---|---|---|
|
String |
Yes |
SCM provider hosting the repository, such as GitHub, Bitbucket, or GitLab. |
|
String |
Yes |
Repository name with owner, for example, |
|
String |
No |
The branch, tag or SHA to check out. The action uses your default branch, unless you check out a repository that triggered a workflow, in which case it defaults to the reference or SHA for that event. |
|
String |
No |
The PAT used to fetch the repository. The PAT is configured with the local Git config, which enables your scripts to run authenticated Git commands. |
|
String |
No |
SSH key used to fetch the repository. The SSH key is configured with the local Git config, which enables your scripts to run authenticated Git commands. |
|
String |
No |
Known hosts in addition to the user and global host key database.
Use the utility |
|
Boolean |
No |
Default is |
|
Boolean |
No |
Default is |
|
String |
No |
The relative path to place the repository under |
|
Boolean |
No |
Default is |
|
Number |
No |
Number of commits to fetch.
Default is |
|
Boolean |
No |
Default is |
|
Boolean |
No |
Default is |
|
Boolean |
No |
Default is |
|
String |
No |
The base URL for the GitHub instance that you are cloning from.
Unless specified, the base URL uses environment defaults to fetch from the same instance the workflow is running from.
Example URLs are |
|
String |
No |
The base URL for the Bitbucket instance that you are cloning from.
Unless specified, the base URL uses environment defaults to fetch from the same instance the workflow is running from.
Example URLs are |
|
String |
No |
The base URL for the GitLab instance that you are cloning from.
Unless specified, the base URL uses environment defaults to fetch from the same instance the workflow is running from.
Example URLs are |
Usage example
In the YAML file, all values are required, unless otherwise noted. Default values are included in the example YAML file below. Refer to the notes for options and details.
CloudBees recommends:
|
In your YAML file, add:
- name: Check out repo uses: cloudbees-io/checkout@v1 with: provider: ${{ cloudbees.scm.provider }} repository: ${{ cloudbees.repository }} ref: '' token: ${{ cloudbees.scm.token }} ssh-key: '' ssh-known-hosts: '' ssh-strict: true persist-credentials: true path: '' clean: true fetch-depth: 1 lfs: false submodules: false set-safe-directory: true github-server-url: '' bitbucket-server-url: '' gitlab-server-url: ''