Trying to use rules if changes and not working

I have this pipeline in a monorepo:

ui:
image: node12
stage: test
rules:

  • changes:
    • ui/**/*
      script:
    • cd $CI_PROJECT_DIR/ui
    • npm install
    • npm run test

But when I make a commit modifying a file outside the ui directory, it still triggers this job…

This is with Gitlab 14.10