guitarrapc / git-shallow-clone-orb

circleci orb to execute git shallow clone for faster checkout.
https://circleci.com/orbs/registry/orb/guitarrapc/git-shallow-clone
MIT License
21 stars 11 forks source link

Allow for PRs from API call; that have /head or /merge suffixes #16

Closed tartale closed 3 years ago

tartale commented 3 years ago

If a user launches a CircleCI pipeline using the API, the $CIRCLE_BRANCH variable is already populated with a /head or /merge suffix (e.g. pull/895/head) - this will cause the shallow checkout to fail.

Use a modified regex such that, if the suffix is already present, we fall through to the third case, where the suffix /head is not added.

guitarrapc commented 3 years ago

Thank you for contribution. I'll release it once CI fixed.

guitarrapc commented 3 years ago

@tartale I've released https://circleci.com/developer/orbs/orb/guitarrapc/git-shallow-clone?version=2.1.0 !