rules:changes does not work for force pushes in branch pipelines

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

  • Close this issue

Summary

This issue is related to #293645 (closed) but describes an additional bug:

When force pushing a branch with changes that should trigger jobs according to rules/changes, this job is not triggered.

Steps to reproduce

  1. Create a project with a CI job containing rules with changes.
  2. Create a branch with changes to a file that should trigger the rule and push
  3. Modify the commit so that it should still trigger the rule and push
  4. Observe that the job with the rules is not triggered

Example Project

See three last pipelines in https://gitlab.com/mlegner/test/-/pipelines (in particular https://gitlab.com/mlegner/test/-/pipelines/442777096).

What is the current bug behavior?

CI containing rules with changes are not triggered when force-pushing a branch with changes to the corresponding files.

What is the expected correct behavior?

CI containing rules with changes are triggered when force-pushing a branch with changes to the corresponding files.

Relevant logs and/or screenshots

First commit Second commit Force push
image image image
  • First commit triggers all jobs irrespective of changes (see #293645 (closed))
  • Second commit works as intended
  • Force push does not trigger pipeline with rules even though there are changes to the corresponding file

Output of checks

This bug happens on GitLab.com

Edited Nov 30, 2025 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading