From fe3758e94993e2494ec9267ecf90fc2b164b5452 Mon Sep 17 00:00:00 2001 From: Ahmed Hemdan Date: Tue, 27 Jun 2023 19:08:38 +0200 Subject: [PATCH] Update README.md on how to disable sast jobs --- README.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 79f77b8..e6c74f2 100644 --- a/README.md +++ b/README.md @@ -17,14 +17,20 @@ include: where `` is the latest released tag or `main`. -If you want to leverage the `$SAST_DISABLED` variable to define or not the jobs conditionally use `include:rules`. -Otherwise all SAST jobs will always run when applicable: +If you want to leverage the `$SAST_DISABLED` variable to run the jobs conditionally use `include:rules` with `when: never`. Otherwise all SAST jobs will always run when applicable: ```yaml include: - component: gitlab.com/gitlab-components/sast@main rules: - - if: $SAST_DISABLED != "true" + - if: $SAST_DISABLED == "true" || $SAST_DISABLED == "1" +``` + +This assumes `SAST_DISABLED` variable is already defined in `.gitlab-ci.yml` with either `'true'` or `'1'` as the value: + +```yaml +variables: + SAST_DISABLED: 'true' ``` ### Inputs