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: Scanning a gitlab project with no commits crashes #3727

Closed
ashearin opened this issue Dec 11, 2023 · 0 comments · Fixed by #3731
Closed

BUG: Scanning a gitlab project with no commits crashes #3727

ashearin opened this issue Dec 11, 2023 · 0 comments · Fixed by #3731
Labels
gitlab Issue related to Scorecard's GitLab client kind/bug Something isn't working

Comments

@ashearin
Copy link
Contributor

Describe the bug
Probably an edge case, but attempting to scan a repo with no commits fails.

$ go run main.go --repo gitlab.com/*****/test-repo
Starting [Vulnerabilities]
Starting [Dependency-Update-Tool]
Starting [Binary-Artifacts]
Starting [Maintained]
Starting [Security-Policy]
Starting [Contributors]
Starting [CII-Best-Practices]
Starting [Packaging]
Starting [Branch-Protection]
Starting [Pinned-Dependencies]
Starting [License]
Starting [Token-Permissions]
Starting [Fuzzing]
Starting [Code-Review]
Starting [Signed-Releases]
Starting [CI-Tests]
Starting [Dangerous-Workflow]
Starting [SAST]
panic: runtime error: index out of range [0] with length 0

Reproduction steps
Steps to reproduce the behavior:

  1. Create new GitLab repository (Do not initialize with a readme)
  2. Set GITLAB_AUTH_TOKEN (if above repo is private)
  3. run scorecard --repo gitlab.com/myrepo

Expected behavior
Scorecard runs/completes without error. Potentially returning a warning, but at least returning no score for anything commit based.

Additional context
Add any other context about the problem here.

@ashearin ashearin added the kind/bug Something isn't working label Dec 11, 2023
@gabibguti gabibguti added the gitlab Issue related to Scorecard's GitLab client label Dec 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gitlab Issue related to Scorecard's GitLab client kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants