Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: shallow checkout if the branch has moved too much foward #63

Open
1 task done
pcorpet opened this issue Sep 23, 2024 · 0 comments
Open
1 task done

Bug: shallow checkout if the branch has moved too much foward #63

pcorpet opened this issue Sep 23, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@pcorpet
Copy link

pcorpet commented Sep 23, 2024

Is there an existing issue for this?

  • 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

@pcorpet pcorpet added the bug Something isn't working label Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant