How do I modify the checkout step?

Overview

In some cases, you may wish to change how the default - checkout step performs the checkout of your code.

Checkout is a special step used to check out source code to the configured path. (The path defaults to the working directory.) It is more of a helper function designed to make checking out code easy for you.

The checkout step is a special convenience step in the form of a string and no additional attributes and it cannot be changed.

GitHub/BitBucket OAuth

If you need to change how the checkout step retrieves your code, you will need to perform raw git commands using a run step. In this, you will be able to customize the checkout process to suit your needs.

Example: 

 - run: git clone -b "$CIRCLE_BRANCH" "$CIRCLE_REPOSITORY_URL"

Please remember to remove the convenience checkout step if adding your custom run step to process the checkout.

 

GitHub App

To do the same as above for an Organization using our GitHub App integration, you can do so via the following:

- run: git clone -b "$CIRCLE_BRANCH" << pipeline.trigger_parameters.github_app.repo_url >>

 

GitLab

To do the same as above for an Organization using our GitLab integration, you can do so via the following:

- run: git clone -b "$CIRCLE_BRANCH" << pipeline.trigger_parameters.gitlab.repo_url >>

Additional Resources 

Was this article helpful?
17 out of 103 found this helpful

Comments

0 comments

Article is closed for comments.