From 0e59346132095cb744741e5327c5117c2cda3c5b Mon Sep 17 00:00:00 2001
From: Pierre Smeyers <pierre.smeyers@gmail.com>
Date: Thu, 18 May 2023 15:00:22 +0200
Subject: [PATCH] feat(release): support configure release commit comments

---
 README.md                     |  4 +++-
 kicker.json                   | 10 ++++++++++
 templates/gitlab-ci-maven.yml |  8 +++++++-
 3 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index dc9724f..b485b74 100644
--- a/README.md
+++ b/README.md
@@ -179,7 +179,9 @@ They are bound to the `publish` stage, and use the following variables:
 | `MAVEN_DEPLOY_FROM_UNPROTECTED_DISABLED`| Set to `true` to limit snapshot publication to protected branches | _none_ (disabled) |
 | `MAVEN_DEPLOY_ARGS`                 | Maven arguments for the `mvn-deploy` job                     | `deploy -Dmaven.test.skip=true` |
 | `MAVEN_RELEASE_ARGS`                | Maven arguments for the `mvn-release` job                    | `release:prepare -DtagNameFormat=@{project.version} -Darguments=-Dmaven.test.skip=true` |
-| `MAVEN_RELEASE_SCM_COMMENT_PREFIX`  | Maven release plugin [scmCommentPrefix](https://maven.apache.org/maven-release/maven-release-plugin/prepare-mojo.html#scmCommentPrefix) parameter  | `chore(maven-release): ` |
+| `MAVEN_RELEASE_SCM_COMMENT_PREFIX`  | Maven release plugin [scmCommentPrefix](https://maven.apache.org/maven-release/maven-release-plugin/prepare-mojo.html#scmCommentPrefix) parameter | `chore(maven-release): ` |
+| `MAVEN_RELEASE_SCM_RELEASE_COMMENT` | Maven release plugin [scmReleaseCommitComment](https://maven.apache.org/maven-release/maven-release-plugin/prepare-mojo.html#scmReleaseCommitComment) parameter (since Maven `3.0.0-M1`) | _none_ (Maven default) |
+| `MAVEN_RELEASE_SCM_DEV_COMMENT`     | Maven release plugin [scmDevelopmentCommitComment](https://maven.apache.org/maven-release/maven-release-plugin/prepare-mojo.html#scmDevelopmentCommitComment) parameter (since Maven `3.0.0-M1`) | _none_ (Maven default) |
 | `MVN_SEMREL_RELEASE_DISABLED`       | Set to `true` to disable [semantic-release integration](#semantic-release-integration)   | _none_ (disabled) |
 
 More info:
diff --git a/kicker.json b/kicker.json
index 3f04db8..22e1460 100644
--- a/kicker.json
+++ b/kicker.json
@@ -150,6 +150,16 @@
           "default": "chore(maven-release): ",
           "advanced": true
         },
+        {
+          "name": "MAVEN_RELEASE_SCM_RELEASE_COMMENT",
+          "description": "Maven release plugin [scmReleaseCommitComment](https://maven.apache.org/maven-release/maven-release-plugin/prepare-mojo.html#scmReleaseCommitComment) parameter\n\n(since Maven `3.0.0-M1`)",
+          "advanced": true
+        },
+        {
+          "name": "MAVEN_RELEASE_SCM_DEV_COMMENT",
+          "description": "Maven release plugin [scmDevelopmentCommitComment](https://maven.apache.org/maven-release/maven-release-plugin/prepare-mojo.html#scmDevelopmentCommitComment) parameter\n\n(since Maven `3.0.0-M1`)",
+          "advanced": true
+        },
         {
           "name": "MVN_SEMREL_RELEASE_DISABLED",
           "description": "Disable semantic-release integration",
diff --git a/templates/gitlab-ci-maven.yml b/templates/gitlab-ci-maven.yml
index 9c19ca8..23e2291 100644
--- a/templates/gitlab-ci-maven.yml
+++ b/templates/gitlab-ci-maven.yml
@@ -564,7 +564,13 @@ mvn-release:
           semrel_args="-DreleaseVersion=${SEMREL_INFO_NEXT_VERSION}"
         fi
       fi
-    - mvn ${TRACE+-X} $MAVEN_CLI_OPTS $mvn_settings_opt $java_proxy_args $scm_auth_args ${MAVEN_RELEASE_ARGS} ${semrel_args} -DscmCommentPrefix="$MAVEN_RELEASE_SCM_COMMENT_PREFIX"
+    - >-
+      mvn ${TRACE+-X} $MAVEN_CLI_OPTS $mvn_settings_opt $java_proxy_args
+      ${scm_auth_args} ${semrel_args}
+      ${MAVEN_RELEASE_SCM_COMMENT_PREFIX+-DscmCommentPrefix="$MAVEN_RELEASE_SCM_COMMENT_PREFIX"}
+      ${MAVEN_RELEASE_SCM_RELEASE_COMMENT+-DscmReleaseCommitComment="$MAVEN_RELEASE_SCM_RELEASE_COMMENT"}
+      ${MAVEN_RELEASE_SCM_DEV_COMMENT+-DscmDevelopmentCommitComment="$MAVEN_RELEASE_SCM_DEV_COMMENT"}
+      ${MAVEN_RELEASE_ARGS}
   rules:
     # exclude if $MAVEN_DEPLOY_ENABLED not set
     - if: '$MAVEN_DEPLOY_ENABLED != "true"'
-- 
GitLab