Merge branch 'update-README-on-how-to-disable-sast-jobs' into 'main'

Update README.md on how to disable sast jobs

See merge request gitlab-components/sast!5
This commit is contained in:
Fabio Pitino 2023-07-05 12:38:27 +00:00
commit d620ae6189

View file

@ -17,16 +17,20 @@ include:
where `<VERSION>` is the latest released tag or `main`. where `<VERSION>` 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`. If you are converting the configuration to use components and want to leverage the existing variable `$SAST_DISABLED` you could conditionally include the component using the variable:
Otherwise all SAST jobs will always run when applicable:
```yaml ```yaml
include: include:
- component: gitlab.com/gitlab-components/sast@main - component: gitlab.com/gitlab-components/sast@main
rules: rules:
- if: $SAST_DISABLED != "true" - if: $SAST_DISABLED == "true" || $SAST_DISABLED == "1"
when: never
``` ```
Otherwise all SAST jobs will always run when applicable.
This assumes `SAST_DISABLED` variable is already defined in `.gitlab-ci.yml` with either `'true'` or `'1'` as the value.
### Inputs ### Inputs
| Input | Default value | Description | | Input | Default value | Description |