我正在尝试 gitlab 默认的秘密检测选项。
这是我正在尝试的 Gitlab CI
文件
include:
- template: Security/Secret-Detection.gitlab-ci.yml
stages:
- test
test:
stage: test
artifacts:
reports:
secret_detection: gl-secret-detection-report.json
script:
- pwd
- ls
- cat gl-secret-detection-report.json
我没有将文件作为工件获取。
我得到的错误是:
cat: can't open 'gl-secret-detection-report.json': No such file or directory
Cleaning up file based variables
00:01
ERROR: Job failed: exit code 1
但是在 Gitlab 的默认阶段它正在创建文件
Uploading artifacts for successful job
00:03
Uploading artifacts...
gl-secret-detection-report.json: found 1 matching files and directories
Uploading artifacts as "secret_detection" to coordinator... ok id=1asdfas239 responseStatus=201 Created token=jT28Z-ot
Cleaning up file based variables
00:00
Job succeeded
所以 secret_detection
阶段正在工作,这是默认使用模板。