continuous-integrationgitlab-cisemgrep

I am getting a non-descript Gitlab CI error. Can anyone help me try to get a better error statement?


I have this non-descript CI error is it possible to get something more descript?

Code Snippet below:

$ semgrep-agent 
| versions - semgrep 0.81.0 on Python 3.9.10 
| environment - running in environment gitlab-ci, triggering event is 'pull_request' 
| manage - not logged in 
=== setting up agent configuration 
| using semgrep rules from https://semgrep.dev/c/p/security-audit 
| using semgrep rules from https://semgrep.dev/c/p/secrets 
An unexpected error occurred: 
   <class 'sh.ErrorReturnCode_1'> 
    RAN: /usr/bin/git merge-base --all b7cb3f8e678d943b4cded2e55d45221fafbde030 FETCH_HEAD 
    STDOUT: 
    STDERR:

Solution

  • What could be happening is that you are setting the git_depth variable to something too low:

    variables:
       GIT_DEPTH: 1
    

    Semgrep needs to fetch commit history to do a diff-aware scan between the source and target branch, so limiting the git_depth might be the cause of some merge-related errors.