mirror of
https://gitlab.com/components/secret-detection.git
synced 2025-06-30 07:28:30 +02:00
Update README.md on how to disable secret-detection job
This commit is contained in:
parent
66e7f4df74
commit
d69665fd97
1 changed files with 10 additions and 2 deletions
12
README.md
12
README.md
|
@ -18,13 +18,21 @@ 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 `$SECRET_DETECTION_DISABLED` variable to run the `secret_detection` job conditionally use `include:rules`. Otherwise the job will run when applicable:
|
If you want to leverage the `$SECRET_DETECTION_DISABLED` variable to run the `secret_detection` job conditionally use `include:rules` with `when: never`. Otherwise the job will run when applicable:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
include:
|
include:
|
||||||
- component: gitlab.com/gitlab-components/secret-detection@main
|
- component: gitlab.com/gitlab-components/secret-detection@main
|
||||||
rules:
|
rules:
|
||||||
- if: $SECRET_DETECTION_DISABLED != "true"
|
- if: $SECRET_DETECTION_DISABLED == "true" || $SECRET_DETECTION_DISABLED == "1"
|
||||||
|
when: never
|
||||||
|
```
|
||||||
|
|
||||||
|
This assumes `SECRET_DETECTION_DISABLED` variable is already defined in `.gitlab-ci.yml` with either `'true'` or `'1'` as the value:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
variables:
|
||||||
|
SECRET_DETECTION_DISABLED: 'true'
|
||||||
```
|
```
|
||||||
|
|
||||||
### Inputs
|
### Inputs
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue