Push rule not working

Summary

We are trying to use a push rule that matches the use of an issue number in the commit message, like #123. So we would like to match:

  • It should begin with # or if it does not begin with # it should at least contain a whitespace character before the #
  • Directly after the # there should be one or more digits
  • It should or end with the digit or have one or more whitespace if there is more text We tried to use the following regex in the push rule on GitLab.com: /(^|\s+)\#(\d+$|\d+\s+)/, but all pushes are rejected. We tested with the following commit messages #1 or test #1 or #1 test or test #1 test. None succeeded

What is the current bug behavior?

Push get's rejected

What is the expected correct behavior?

Push should succeed

Output of checks

This bug happens on GitLab.com

Edited Jun 16, 2025 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading