secret_detection job in 14.9 fails in small repositories: "fatal: --unshallow on a complete repository does not make sense"
Summary
Steps to reproduce
- Have a project with a small number of commits, e.g. 7
- Include this in your CI:
include:
- template: Security/Secret-Detection.gitlab-ci.yml
secret_detection:
variables:
# Run on the entire Git history of a repository.
# https://docs.gitlab.com/ee/user/application_security/secret_detection/#custom-settings-example
SECRET_DETECTION_HISTORIC_SCAN: "true"
- Run a CI pipeline
What is the current bug behavior?
Executing "step_script" stage of the job script 00:01
Using docker image sha256:f79526522cc5925f34865f06a3564f32729f77040173a1abc939680c4b0b6995 for registry.gitlab.com/security-products/secrets:3 with digest registry.gitlab.com/gitlab-org/security-products/analyzers/secrets@sha256:d87684cc7e034c583b1582069d6f6f845a9276f562ae385428b4c8508334ac3a ...
$ if [ -n "$CI_COMMIT_TAG" ]; then echo "Skipping Secret Detection for tags. No code changes have occurred."; exit 0; fi
$ if [ "$SECRET_DETECTION_HISTORIC_SCAN" == "true" ] # collapsed multi-line command
historic scan
fatal: --unshallow on a complete repository does not make sense
Uploading artifacts for failed job
Results of GitLab environment info
Just updated from 14.8.2 to 14.9.2
Bug location
cc @marcel.amirault @zrice @matteeyah
This might be relevant: https://github.com/jderusse/docker-gitsplit/issues/18
Workaround
Disable SECRET_DETECTION_HISTORIC_SCAN
.
(~regression:14.9
)
Edited by hash