Goal
The release pipeline should start a deployment for specific branches.
This should not happen (skip the job), if there are only documentation changes. (*.md
files)
The problem
If you change multiple files, but only one file ends in
.md
, thebuild
job is still skipped. The job does not run for any of the files.
https://docs.gitlab.com/ee/ci/jobs/job_control.html#onlychanges--exceptchanges-examples
So, is it even possible to specifcy a rule as mentioned above?
What I tried so far (an excerpt)
So, if "*.md"
doesn't work, is it possible to revert it?
"**/!(*.md)" # Every file except *.md
This does not execute anything
rules:
- if: $CI_COMMIT_BRANCH == "main"
changes:
- "**/!(*.md)" # Every file except *.md
This executes always
rules:
- if: $CI_COMMIT_BRANCH == "main"
- changes:
- "**/!(*.md)"
Question
Do I have to use custom variables to solve this problem or is there a simpler way?