Gitlab CI: Using wildcard with include keyword

Viewed 822

I am using below to trigger pipeline if any changes are made in the folders under root directory.


trigger_serviceA:
  stage: triggers  
  rules:        
    - if: '$CI_COMMIT_BRANCH == "dev"'
      changes: 
        - serviceA/*      
      when: always  
  trigger:
    include: serviceA/.gitlab-ci.yml    
    strategy: depend 

However, pipeline is not getting triggered if there are any changes in the subfolders under serviceA.

1 Answers

When using only:changes the single wildcard does not covers subdirs - you'll have to use /**/* instead.

Altough the documentation does not say it, i could imagine that it's the same for rules:changes - so maybe you'll want to try that out.

Related