gpt4 book ai didi

gitlab - gitlab静态应用程序安全测试错误 "sast job: chosen stage does not exist; available stages are"

转载 作者:行者123 更新时间:2023-12-02 18:36:04 26 4
gpt4 key购买 nike

我尝试关注 these fairly simple instructions for integrating Static Application Security Testing (SAST)进入我在 Gitlab 上的 Android CI/CD 管道。但是,在使用 CI lint tool 时出现以下错误:

sast job: chosen stage does not exist; available stages are .pre, stg_build, stg_test, .post

这是重现错误的最简单版本的 .gitlab-ci.yml:

include:
- template: Security/SAST.gitlab-ci.yml

variables:
SAST_EXPERIMENTAL_FEATURES: "true"

stages:
- stg_build
- stg_test

我在GitLab: chosen stage does not exist中发现了类似的错误但那是关于尝试使用环境变量作为舞台名称。

如何防止此错误并让 SAST 为我在 Gitlab 上的合并请求工作?

最佳答案

问题是 Security/SAST.gitlab-ci.yml 模板期望有一个名为 test 的阶段,但 .gitlab-ci.yml 中的测试阶段已重命名为“stg_test”。

我找到了两种方法来满足 CI Lint 工具的要求:

  1. 将“stg_test”重命名为“test”
  2. 将 sast 脚本配置为在“stg_test”期间运行,但将以下内容添加到 .gitlab-ci.yml:
sast:
stage: stg_test

来源:

  1. gitlab developer community
  2. Getting error message sast job: stage parameter should be [some stage name here]

关于gitlab - gitlab静态应用程序安全测试错误 "sast job: chosen stage does not exist; available stages are",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68764789/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com