[gnome-shell] ci/check-commit-log: Reverse the merge request URL check
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] ci/check-commit-log: Reverse the merge request URL check
- Date: Tue, 17 Nov 2020 17:38:07 +0000 (UTC)
commit 5f7615d3fcc7d9b737439b60237e6f20e6f47d24
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Fri Nov 6 17:59:28 2020 +0100
ci/check-commit-log: Reverse the merge request URL check
Instead of making sure there is a reference to a bug or merge request,
make sure there isn't. The reason for this is that marge-bot will always
append a merge request URL in the end of the commit message.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1491>
.gitlab-ci/check-commit-log.sh | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/.gitlab-ci/check-commit-log.sh b/.gitlab-ci/check-commit-log.sh
index 8d0e2ee039..5a469328d6 100755
--- a/.gitlab-ci/check-commit-log.sh
+++ b/.gitlab-ci/check-commit-log.sh
@@ -16,16 +16,16 @@ if [ -z "$commits" ]; then
exit 1
fi
-function commit_message_has_url() {
+function commit_message_has_mr_url() {
commit=$1
commit_message=$(git show -s --format='format:%b' $commit)
- echo "$commit_message" | grep -qe
"\($CI_MERGE_REQUEST_PROJECT_URL/\(-/\)\?\(issues\|merge_requests\)/[0-9]\+\|https://bugzilla.gnome.org/show_bug.cgi?id=[0-9]\+\)"
+ echo "$commit_message" | grep -qe
"^$CI_MERGE_REQUEST_PROJECT_URL\/\(-\/\)\?merge_requests\/$CI_MERGE_REQUEST_IID$"
return $?
}
for commit in $commits; do
- if ! commit_message_has_url $commit; then
- echo "Missing merge request or issue URL on commit $(echo $commit | cut -c -8)"
+ if commit_message_has_mr_url $commit; then
+ echo "Commit $(echo $commit | cut -c -8) message must not contain a link to its own merge request"
exit 1
fi
done
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]