[polari/gnome-3-38] ci: Replace custom commit-log script with ci-fairy



commit 3c9c6ce2f86609e8c1d485b6e144704b1d2d0ffc
Author: Florian Müllner <fmuellner gnome org>
Date:   Thu Dec 17 14:24:46 2020 +0100

    ci: Replace custom commit-log script with ci-fairy
    
    ci-fairy now supports checking commit messages for required/disallowed
    patterns. Use that to replace our custom commit-log script.
    
    https://gitlab.gnome.org/GNOME/polari/-/merge_requests/171

 .gitlab-ci.yml                 |  9 +++--
 .gitlab-ci/check-commit-log.sh | 74 ------------------------------------------
 .gitlab-ci/commitrules.yml     |  4 +++
 3 files changed, 11 insertions(+), 76 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index e202d593..1da79c0c 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,6 +1,6 @@
 include:
  - remote: 'https://gitlab.gnome.org/GNOME/citemplates/raw/master/flatpak/flatpak_ci_initiative.yml'
- - remote: 
'https://gitlab.freedesktop.org/freedesktop/ci-templates/-/raw/8445ff7af2a68795afb98f486251f2ef8f90621c/templates/ci-fairy.yml'
+ - remote: 
'https://gitlab.freedesktop.org/freedesktop/ci-templates/-/raw/18194044f0f984c8815bc9a1a146582f6bf15d41/templates/ci-fairy.yml'
 
 stages:
  - pre_review
@@ -44,7 +44,12 @@ check_commit_log:
         - .fdo.ci-fairy
     stage: pre_review
     script:
-        - ./.gitlab-ci/check-commit-log.sh
+        - if [[ x"$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" != "x" ]] ;
+          then
+            ci-fairy check-commits --junit-xml=commit-message-junit-report.xml ;
+          else
+            echo "Not a merge request" ;
+          fi
     <<: *pipeline_guard
     artifacts:
         expire_in: 1 week
diff --git a/.gitlab-ci/commitrules.yml b/.gitlab-ci/commitrules.yml
new file mode 100644
index 00000000..a586c38c
--- /dev/null
+++ b/.gitlab-ci/commitrules.yml
@@ -0,0 +1,4 @@
+patterns:
+  require:
+    - regex: 
($CI_MERGE_REQUEST_PROJECT_URL/(-/)?(issues|merge_requests)/[0-9]+|https://bugzilla.gnome.org/show_bug.cgi?id=[0-9]+)
+      message: Commit message must contain a link to an issue or merge request


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]