Checkout step intermittently uses https instead of ssh

The checkout step seems to randomly switch between https and ssh. According to the docs:

The checkout command automatically adds the required authenticity keys for interacting with GitHub and Bitbucket over SSH

This has been working fine until recently, when checkouts started happening over https.
How can I reliably get it to use ssh, as my pipeline needs the github ssh keys to use update git submodules?

Example logs when checkout uses ssh (github ssh keys automatically added. Nice):

Creating .ssh directory
Adding the following entries to known_hosts:
github.com ssh-rsa ...
github.com ecdsa-sha2-nistp256 ...
github.com ssh-ed25519 ...
...
Writing SSH key for checkout to "/home/circleci/.ssh/id_rsa"
Writing SSH public key for checkout to "/home/circleci/.ssh/id_rsa.pub"
Cloning git repository - git@github.com:<org>/<repo>.git
Checking out branch

Example logs when checkout uses https (and therefore doesn’t add the github ssh keys):

Using subcommand credential helper for git operations
Cloning git repository - https://github.com/<org>/<repo>.git

Any help would be appreciated!