mirror of
https://gitlab.com/components/sast.git
synced 2025-06-30 15:38:29 +02:00
Update README.md on how to disable sast jobs
This commit is contained in:
parent
999bd9d0c2
commit
fe3758e949
1 changed files with 9 additions and 3 deletions
12
README.md
12
README.md
|
@ -17,14 +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 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:
|
||||||
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"
|
||||||
|
```
|
||||||
|
|
||||||
|
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
|
### Inputs
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue