Rules - skip if changes only to specific file

With this:

.ignore-readme:
  rules:
    - changes:
        - "README.md"
      when: never
    - when: always

my pipeline is not triggered if there are any changes to README.md regardless of whether there are changes in other files.

I want it to work like this:
If the only file with changes in a commit is README.md - don’t trigger. (Works as intended)
If any other file has changes - trigger. (Works as intended)
If any other file AND README.md - trigger. (Right now it doesn’t)

How can I fix this?

1 Like

Has this been ever solved?

There are some possible answers here.

I’ve just tested the @peterpop solution and looks like it is still working in the same way.
Here it is my gitlab-ci.yml where I applied the rule under the workflow.

When the commit changes only contains the README file, the pipeline is not trigger, but, the same happens when it contains the README plus any other file

Finally, instead of not running the pipeline when the README file is changed, I run the pipeline when the pipeline “relevant files” are changed. gitlab-ci.yml.