From c8d9a8cde553ae4a56e7353ad42e0759e6199fce Mon Sep 17 00:00:00 2001 From: Ivan Artiukhov Date: Thu, 19 Sep 2024 09:38:08 +0100 Subject: [PATCH 1/5] fix: update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1d2d3ec..da98ab4 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # `pre-commit` -> Executes all configured [pre-commit][pre-commit] hooks in the CI +> Executes all configured [pre-commit][pre-commit] hooks in the CI. ## Getting Started -- GitLab From 71808f027214c9dd864094d12c6e4a5ee1a90d9a Mon Sep 17 00:00:00 2001 From: Ivan Artiukhov Date: Thu, 19 Sep 2024 09:42:16 +0100 Subject: [PATCH 2/5] fix: removes unwanted rules --- .gitlab-ci.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f521822..30f0f2c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -22,13 +22,9 @@ build-and-push-docker-image: - echo "Building and pushing image." - docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA -f templates/Dockerfile . - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA - rules: - - if: $CI_PIPELINE_SOURCE == 'merge_request_event' lint: extends: .pre-commit - rules: - - if: $CI_PIPELINE_SOURCE == 'merge_request_event' semantic-release: stage: .post -- GitLab From 20750d0355e89397a8f813cec78d3110f39353e2 Mon Sep 17 00:00:00 2001 From: Ivan Artiukhov Date: Thu, 19 Sep 2024 10:15:53 +0100 Subject: [PATCH 3/5] fix: adds the rules --- .gitlab-ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 30f0f2c..f521822 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -22,9 +22,13 @@ build-and-push-docker-image: - echo "Building and pushing image." - docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA -f templates/Dockerfile . - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA + rules: + - if: $CI_PIPELINE_SOURCE == 'merge_request_event' lint: extends: .pre-commit + rules: + - if: $CI_PIPELINE_SOURCE == 'merge_request_event' semantic-release: stage: .post -- GitLab From 35af139da0b1a3df0739f903cea6bae8e57db22c Mon Sep 17 00:00:00 2001 From: Ivan Artiukhov Date: Fri, 20 Sep 2024 10:46:46 +0100 Subject: [PATCH 4/5] fix: adds rules --- templates/pre-commit.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/templates/pre-commit.yml b/templates/pre-commit.yml index e10fa69..7caf82d 100644 --- a/templates/pre-commit.yml +++ b/templates/pre-commit.yml @@ -94,5 +94,7 @@ spec: - !reference [.pre-commit-fragment, run-pre-commit-gc] artifacts: paths: - - $PATCH_FILE when: on_failure + rules: + - if: $CI_MERGE_REQUEST_DIFF_BASE_SHA + -- GitLab From 261e5d5555cb3d6b7b17bc6164a0c2d33d13fa43 Mon Sep 17 00:00:00 2001 From: Ivan Artiukhov Date: Fri, 20 Sep 2024 10:50:54 +0100 Subject: [PATCH 5/5] fix: returns the patch path --- templates/pre-commit.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/pre-commit.yml b/templates/pre-commit.yml index 7caf82d..7afc4c6 100644 --- a/templates/pre-commit.yml +++ b/templates/pre-commit.yml @@ -94,6 +94,7 @@ spec: - !reference [.pre-commit-fragment, run-pre-commit-gc] artifacts: paths: + - $PATCH_FILE when: on_failure rules: - if: $CI_MERGE_REQUEST_DIFF_BASE_SHA -- GitLab