Hi,
I would like to run a particular job if a particular file has been changed.
Consider the following .gitlab-ci.yml
:
stages:
- test
always:
stage: test
image: alpine
script:
- env | sort
change:
stage: test
image: alpine
rules:
- changes:
paths:
- dir/file
script:
- echo "dir/file"
If I modify and commit to the default (main
) branch:
- the
dir/file
, it triggers both thealways
andchange
job - any other file it will trigger only the
always
job
as expected.
Instead If I modify and commit to any other branch (ie create a merge request) it will run both jobs even if I do not modify the dir/file
file.
Am I missing something?
Thanks