Backend: gitlab-ci "rules" should support extended globbing or some negation of changes/exists

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

Problem to solve

Run a job only if at least one file was changed. Currently the CI keyword allows pattern matching, but does not allow any sort of negation pattern matching.

Proposal

job1:
  script:
    - exit 0
  rules:
    - changes:
        regexp: "^.*\/\!\(.*\.html\)$"

job2:
  script:
    - exit 0
  rules:
    - exists:
        regexp: "^.*\/\!\(.*\.html\)$"

Note: iterate the file names and scan them with this regexp (for html).

⚠️ We need to set a Regexp timeout (0.001 seconds?) to prevent abuse. The MR for setting the timeout has been merged: !145679 (merged)

Edited by 🤖 GitLab Bot 🤖