Commit 28545726 authored by Stan Hu's avatar Stan Hu Committed by Philippe Lafoucrière

Improve error message in DAST CI template

When DAST_WEBSITE is not defined in a pipeline, the template will still
attempt to run the analyzer but fail without any explanation.

This change in the template will output an error and a link to the
documentation if the variable is not set.
parent 9ebf05b5
---
title: Improve error message in DAST CI template
merge_request: 29388
author:
type: other
...@@ -22,6 +22,7 @@ dast: ...@@ -22,6 +22,7 @@ dast:
allow_failure: true allow_failure: true
script: script:
- export DAST_WEBSITE=${DAST_WEBSITE:-$(cat environment_url.txt)} - export DAST_WEBSITE=${DAST_WEBSITE:-$(cat environment_url.txt)}
- if [ -z "$DAST_WEBSITE$DAST_API_SPECIFICATION" ]; then echo "Either DAST_WEBSITE or DAST_API_SPECIFICATION must be set. See https://docs.gitlab.com/ee/user/application_security/dast/#configuration for more details." && exit 1; fi
- /analyze - /analyze
artifacts: artifacts:
reports: reports:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment