diff --git a/README.md b/README.md index 9314864..3210499 100644 --- a/README.md +++ b/README.md @@ -18,13 +18,21 @@ include: where `` 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 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 +``` + +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