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

Be able to scan non git folders #1497

Closed
joevin-slq-docto opened this issue Feb 13, 2024 · 4 comments
Closed

Be able to scan non git folders #1497

joevin-slq-docto opened this issue Feb 13, 2024 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@joevin-slq-docto
Copy link

joevin-slq-docto commented Feb 13, 2024

Description & Reproduction

Probably due to latest git integrations, it's not possible anymore to scan a basic folder:

$ bearer scan myfolder/
Analyzing codebase
⠋  (48/-) [0s] 
Error: failed to get git context: exit status 128
-- git output --
fatal : ni ceci ni aucun de ses répertoires parents n'est un dépôt git : .git
-- end git output --

Expected Behavior

Would it be possible to make bearer work even without a .git folder?

Your Environment

  • Output of bearer version:
bearer version: 1.38.0,
sha: a40d59aa6c98a55b5389e7675ed58a4c094632c6
@joevin-slq-docto joevin-slq-docto added the bug Something isn't working label Feb 13, 2024
@cfabianski
Copy link
Collaborator

Hey @joevin-slq-docto

You should be able to run it outside of a Git repo.
Is that local or somewhere else?

You can also try the NO_GIT=true flag

@123Haynes
Copy link

123Haynes commented Feb 15, 2024

I'm getting the same problem as well with the latest bearer version when trying to scan local git repositories.
The problem seems to be the command git rev-parse --abbrev-ref "origin/HEAD"
This produced the mentioned error.
If I slightly change the command like this it returns a valid branch name:
git rev-parse --abbrev-ref "HEAD"

edit:
I've tested some more with different pcs.
It works fine with one pc and doesn't work with the other.
The only difference I can see at a first glance is the git version.
On the pc with git 2.30.0 it doesn't work, on the pc with git 2.34.1 it works

@cfabianski
Copy link
Collaborator

@123Haynes Yeah indeed, Bearer requires 2.34+
We will make it clearer in the doc.

Thanks for the investigation

@gotbadger
Copy link
Contributor

updated the doc to reflect version requirements

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

4 participants