Rules:changes dont work for triggers

Rules:Changes not working when using triggers

Summary

Using rules:changes does not process the changes as per expectation when using pipeline triggers

Steps to reproduce

  1. create a project with only a js folder
  2. create a gitlab-ci.yml file with the following content .gitlab-ci.yml · dd08a97e7ef2f48faf50b2dc3bf39a430c7a5c51 · Haris Ali Khan / gitlab-ci-rules-testing · GitLab
  3. create 2 branches, one with changes inside the js folder and one with changed outside the js folder
  4. create a merge request and notice pipelines wont be run on the merge request creation.
  5. using curl, call the triggers api to run the pipeline for both the merge requests (Triggering pipelines through the API | GitLab)
  6. notice the pipelines run for both the branches (one with the changes inside the js folder as well as the one with changes outside the js folder)

Example Project

Refer to the following repo: Branches · Haris Ali Khan / gitlab-ci-rules-testing · GitLab the rules: changes should only rule if any changes has been done in the js/**/* but it would still end up running if the changes have been done outside the js folder. Refer to the following Merge request created. After the MR were created, external apis we haris.ali.khan/gitlab-ci-rules-testing!7 haris.ali.khan/gitlab-ci-rules-testing!6