(note: response generated by AI, sourced from CircleCI assets)
Based on the provided configuration, you are already using the circleci/path-filtering orb to detect changes in specific directories and trigger corresponding workflows. However, you want to modify this behavior such that when changes are made both in the helm/ directory and somewhere else, only the build-deploy workflow should run.
To achieve this, you could modify the mapping in your config.yml file to set the only_deploy parameter to true only when changes are exclusively in the helm/ directory. This can be done by adding a negative lookahead in the regular expression for the build_deploy parameter to exclude changes in the helm/ directory. Here’s how you can modify the mapping:
mapping: |
^(?!helm/).* build_deploy true
^helm/.*$ only_deploy true
In this configuration:
- The
build_deployparameter is set totruewhen changes are made anywhere except thehelm/directory. - The
only_deployparameter is set totrueonly when changes are exclusively in thehelm/directory.
This way, if changes are made both in the helm/ directory and somewhere else, only the build-deploy workflow will run.
Please note that this solution assumes that the circleci/path-filtering orb supports negative lookaheads in regular expressions. If it doesn’t, this solution may not work.
For more information on how to use the circleci/path-filtering orb, you can refer to the CircleCI Developer Hub and the CircleCI Docs.
Sources:
- Forum Post: Circleci Path filtering orb: All workflows are running despite folder specific changes
- Forum Post: Run jobs based on changes in directory
- Tutorial > Blog > Machine learning CI/CD with AWS SageMaker > Dynamic configuration
- Help Article > Overview > Tip 4: Split Config Using Dynamic Configuration
- Docs > Using dynamic configuration > Setup configuration:
config.yml>code-config.ymlPart 1 - Docs > Using dynamic configuration > Setup configuration:
config.yml>code-config.ymlPart 2