Reputation: 13175
I tried following these fairly simple instructions for integrating Static Application Security Testing (SAST) into my Android CI/CD pipeline on Gitlab. However, I got the following error when using the CI lint tool:
sast job: chosen stage does not exist; available stages are .pre, stg_build, stg_test, .post
Here is the simplest version of my .gitlab-ci.yml that reproduces the error:
include:
- template: Security/SAST.gitlab-ci.yml
variables:
SAST_EXPERIMENTAL_FEATURES: "true"
stages:
- stg_build
- stg_test
I found a similar error in GitLab: chosen stage does not exist but that was about trying to use an environment variable as a stage name.
How do I prevent this error and get SAST working for my merge requests on Gitlab?
Upvotes: 3
Views: 12304
Reputation: 13175
The problem is the Security/SAST.gitlab-ci.yml
template expects there to be a stage named test
but the test stage in .gitlab-ci.yml was renamed "stg_test".
I was able to find two ways to satisfy the CI Lint tool:
sast:
stage: stg_test
Sources:
Upvotes: 7