mirror of
https://gitlab.com/components/sast.git
synced 2025-06-30 15:38:29 +02:00
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:
commit
d620ae6189
1 changed files with 7 additions and 3 deletions
10
README.md
10
README.md
|
@ -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 |
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue