From d69665fd97fe6b80fb74294d4edf66419a113eee Mon Sep 17 00:00:00 2001 From: Ahmed Hemdan Date: Tue, 27 Jun 2023 16:06:50 +0200 Subject: [PATCH 1/4] Update README.md on how to disable secret-detection job --- README.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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 From f854e6f0b5baa090b2e1702f0832f56a00402322 Mon Sep 17 00:00:00 2001 From: Ahmed Hemdan Date: Tue, 4 Jul 2023 20:51:39 +0200 Subject: [PATCH 2/4] Apple review feedback --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3210499..9a02d0e 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ 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` with `when: never`. 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: @@ -28,6 +28,8 @@ include: 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: ```yaml From 0c82d65e6112d35dce8445c5abd23d7d7a7c5c44 Mon Sep 17 00:00:00 2001 From: Fabio Pitino Date: Wed, 5 Jul 2023 07:49:23 +0000 Subject: [PATCH 3/4] Apply 1 suggestion(s) to 1 file(s) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9a02d0e..1657270 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ include: - component: gitlab.com/gitlab-components/secret-detection@main rules: - if: $SECRET_DETECTION_DISABLED == "true" || $SECRET_DETECTION_DISABLED == "1" - when: never + when: never ``` Otherwise the job will run when applicable. From 19e07ad22a0594b73f68e9840551c6d2ef9509f9 Mon Sep 17 00:00:00 2001 From: Ahmed Hemdan Date: Wed, 5 Jul 2023 13:05:23 +0200 Subject: [PATCH 4/4] Apply feedback again --- README.md | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/README.md b/README.md index 1657270..f7890a7 100644 --- a/README.md +++ b/README.md @@ -30,12 +30,7 @@ include: 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: - -```yaml -variables: - SECRET_DETECTION_DISABLED: 'true' -``` +This assumes `SECRET_DETECTION_DISABLED` variable is already defined in `.gitlab-ci.yml` with either `'true'` or `'1'` as the value. ### Inputs