git-shallow-clone-orb
git-shallow-clone-orb copied to clipboard
Bug: shallow checkout if the branch has moved too much foward
Is there an existing issue for this?
- [X] I have searched the existing issues
Orb version
2.5.0
Current behavior
I use the simple checkout command in my job:
steps:
- git-shallow-clone/checkout
It is part of a workflow that springs on my main
branch and is gated by an approval in Circle CI which allows me to start this workflow only on some commits of my branch. However if I try to approve it for an older commit, then the shallow clone fails.
I believe it should not try to start the fetch from the current branch, but from the Circle SHA1, or maybe at least add an option where one can checkout only the code at CIRCLE_SHA1 version without caring about the branch anymore.
Minimum reproduction config
---
version: 2.1
orbs:
git-shallow-clone: guitarrapc/[email protected]
workflows:
release:
jobs:
- manual-approval:
only-on-branch: main
type: approval
filters:
branches:
only:
- main
- start-release:
requires: manual-approval
jobs:
start-release:
executor: python/default
steps:
- git-shallow-clone/checkout
Add this config above, then create 20+ additional commits on the main branch, then go back in CircleCI to approve the "manual-approval" job of the release workflow for an old commit of the main branch.
Other
No response