Feature Request: changes_exclude keyword request for excluding files in change detection in rules and only
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
<!-- This template is a great use for issues that are feature::additions or technical tasks for larger issues.-->
### Proposal
<!-- Use this section to explain the feature and how it will work. Adding technical details, design proposals, and links to related epics or issues can be helpful. -->
<!-- Consider adding related issues and epics to this issue. You can also reference the Feature Proposal Template (https://gitlab.com/gitlab-org/gitlab/-/blob/master/.gitlab/issue_templates/Feature%20proposal%20-%20detailed.md) for additional details to consider adding to this issue. Additionally, as a data-oriented organization, when your feature exits planning breakdown, consider adding the `What does success look like, and how can we measure that?` section.
-->
<!-- Label reminders
Use the following resources to find the appropriate labels:
- Use only one tier label choosing the lowest tier this is intended for
- https://gitlab.com/gitlab-org/gitlab/-/labels
- https://about.gitlab.com/handbook/product/categories/features/
-->
/label ~group:: ~section:: ~Category:
/label ~"GitLab Free" ~"GitLab Premium" ~"GitLab Ultimate"
/label ~"type::feature" ~"feature::addition" ~"Documentation guidelines"
I propose a feature to be added to the GitLab CI configuration, under rules or only keywords for specifying the job configuration, and that is **changes_exclude** which would do the opposite of the changes keyword, that is to exclude detection of changes in the specified paths. It should also be able to be bundled together with changes to exclude specific subpaths or files that the changes keyword specifies.
## Examples
This job would only run if there are changes detected in the README or CHANGELOGS file:
Docs:
stage: test
image: node:16-bullseye-slim
script:
- echo "Only docs were updated!"
- exit 0
tags:
- docker
- linux
rules:
- changes:
- README.md
- CHANGELOGS.md
And this job would only run if there are no changes detected in the README or CHANGELOGS files:
Project:
stage: test
image: node:16-bullseye-slim
script:
- echo "Docs were not updated!"
- exit 0
tags:
- docker
- linux
rules:
- changes_exclude:
- README.md
- CHANGELOGS.md
And finally, this job would run if there are changes detected in anything except README or CHANGELOGS files:
Project:
stage: test
image: node:16-bullseye-slim
script:
- echo "Everything but the docs was updated!"
- exit 0
tags:
- docker
- linux
rules:
- changes:
- '*'
changes_exlude:
- README.md
- CHANGELOGS.md
Edited by 🤖 GitLab Bot 🤖