Checkout
This batch mode action checkouts a repository to the provided volume to make it available in your workflow. By default, it only fetches a single commit.
Quick example:
Arguments:
clone_uri
clone_uri
The URL of the Git repository you want to clone. Both https://
and git@
notations are supported.
Example
Note that you should provide a ssh_key_secret
when using the SSH clone notation (git@...
).
clone_depth
clone_depth
Number of commits to fetch. "1"
by default, which means only a single commit will be cloned. To clone the entire repo, set this to "0"
.
Example
ref
ref
Name of a branch, Git tag, or a commit SHA to fetch. Uses the remote HEAD by default.
Example
ssh_key_secret
ssh_key_secret
If you're using a Unix machine with default configuration, you can upload your current private key by using this command:
Example
checkout_to
checkout_to
A URI of a storage folder or disk to use as a volume for checkout. When using a disk, you can specify the directory to checkout via checkout_subpath
.
Note that the corresponding directory should exist for storage:
volumes. If you want to automatically create a sub-directory, use checkout_subpath
.
Examples
Storage-based volume
Disk-based volume
checkout_subpath
checkout_subpath
A relative path under checkout_to
to use as a cloning destination directory. If such folder doesn't exist, it will be automatically created.
Example
erase_subpath
erase_subpath
Enables purging of the directory specified by checkout_subpath
. Use with caution, as this is the same as running the rm -rf checkout_subpath
command. To enable this feature, set input to "true"
.
Example
Outputs:
head_sha
head_sha
A SHA of the commit under the current HEAD in the cloned repository. This output's main goal is to make the action cache-friendly - even if the repository didn't change, that output will be the same and the depending action can safely use the cache.
Last updated
Was this helpful?