[gnome-shell] ci: Replace custom commit-log script with ci-fairy



commit da09c67600df16c3d1457e7205ffef43e1eb9d3a
Author: Florian Müllner <fmuellner gnome org>
Date:   Tue Dec 15 17:57:12 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.
    
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1544>

 .gitlab-ci.yml                 |  9 +++--
 .gitlab-ci/check-commit-log.sh | 74 ------------------------------------------
 .gitlab-ci/commit-rules.yml    |  4 +++
 3 files changed, 11 insertions(+), 76 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 07fb97a88c..9cf82c416e 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,7 +1,7 @@
 include:
     - remote: 'https://gitlab.gnome.org/GNOME/citemplates/raw/master/flatpak/flatpak_ci_initiative.yml'
     - remote: 
'https://gitlab.freedesktop.org/freedesktop/ci-templates/-/raw/7ea696055e322cc7aa4bcbe5422b56a198c4bdff/templates/fedora.yml'
-    - remote: 
"https://gitlab.freedesktop.org/freedesktop/ci-templates/-/raw/8445ff7af2a68795afb98f486251f2ef8f90621c/templates/ci-fairy.yml";
+    - remote: 
"https://gitlab.freedesktop.org/freedesktop/ci-templates/-/raw/6f86b8bcb0cd5168c32779c4fea9a893c4a0c046/templates/ci-fairy.yml";
 
 stages:
  - pre_review
@@ -80,7 +80,12 @@ check_commit_log:
     variables:
         GIT_DEPTH: "100"
     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/commit-rules.yml b/.gitlab-ci/commit-rules.yml
new file mode 100644
index 0000000000..ef7d0805af
--- /dev/null
+++ b/.gitlab-ci/commit-rules.yml
@@ -0,0 +1,4 @@
+patterns:
+  deny:
+    - regex: '^$CI_MERGE_REQUEST_PROJECT_URL/(-/)?merge_requests/$CI_MERGE_REQUEST_IID$'
+      message: Commit message must not contain a link to its own merge request


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