Gitlab CI only:changes not work

Hi.

I have a gitlab-ci file like this in a private repo:

pages:
  image: node:14.17.0
  
  cache:
    paths:
    - node_modules/
  
  script:
  - yarn install
  - yarn build
  - mv docs/.vuepress/dist/ public/

  artifacts:
    paths:
    - public
  
  only:
    changes:
    - docs/*
    - package.json
    - yarn.lock

I wish it could trigger a pipeline everytime I push something to the docs/*

But it didn’t. And I have to manually create pipeline for this to run.

Could anyone help me with this? A huge thanks.

Hi @orwill
If this is your complete .gitlab-ci.yml file you are missing stages: and stage: keywords.
If I include stage definitions I cannot reproduce your issue based on the .gitlab-ci.yml you have provided.