mirror of
https://gitlab.com/components/secret-detection.git
synced 2025-06-30 07:28:30 +02:00
Merge branch 'update-README-on-how-to-disable-secret-detection-job' into 'main'
Update README.md on how to disable secret-detection job See merge request gitlab-components/secret-detection!2
This commit is contained in:
commit
622e9b9e92
1 changed files with 7 additions and 2 deletions
|
@ -18,15 +18,20 @@ include:
|
|||
|
||||
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 are converting the configuration to use components and want to leverage the existing variable `$SECRET_DETECTION_DISABLED` you could conditionally include the component using the variable:
|
||||
|
||||
```yaml
|
||||
include:
|
||||
- component: gitlab.com/gitlab-components/secret-detection@main
|
||||
rules:
|
||||
- if: $SECRET_DETECTION_DISABLED != "true"
|
||||
- if: $SECRET_DETECTION_DISABLED == "true" || $SECRET_DETECTION_DISABLED == "1"
|
||||
when: never
|
||||
```
|
||||
|
||||
Otherwise the job will run when applicable.
|
||||
|
||||
This assumes `SECRET_DETECTION_DISABLED` variable is already defined in `.gitlab-ci.yml` with either `'true'` or `'1'` as the value.
|
||||
|
||||
### Inputs
|
||||
|
||||
| Input | Default value | Description |
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue