Custom Checkout command

Hi folks,

I know there have been several requests over time for the ability to modify the checkout step. It was previously thought to be not possible by users due to the $CHECKOUT_KEY env only existing in the checkout step.

However, if you don’t mind setting your private key as an environmental variable, you can manually recreate the checkout step yourself.

As a personal side project, that’s what I did, and I’m sharing it here: https://gist.github.com/drazisil/e97dc21454120251472154de1c1b1c7b

You would call it like so:

      - run:
          name: Attempt manual checkout
          command: |
            bash <(curl -s https://gist.githubusercontent.com/drazisil/e97dc21454120251472154de1c1b1c7b/raw/d1a29f06d503eee4b40625298a828b363f16e5bc/checkout.sh)

Thanks to it being a gist, it is secured by it’s SHA, so if I make any changes the SHA will change and you would know. I set the base64 of the private key as an env on CircleCI called $MANUAL_CHECKOUT_KEY. The `config.yml calls the raw URL of the gist.

There is a public POC on CircleCI at https://circleci.com/gh/drazisil/mco-server/389

This idea is 100% not supported by anyone, including myself or CircleCI. If it helps you with a project, great. If it doesn’t work for you, well, that’s what open code and creative developers are for. Enjoy! :slight_smile:

4 Likes

Hi,
Is $CHECKOUT_KEY, $CHECKOUT_KEY_PUBLIC is special for circleci’s checkout command?
Still no way to retrieve it from third-party orb without settings ENV?

Sadly, missing this small functionality blocks developer to offer better experiences with custom checkout orbs.

1 Like