Break down `only:refs` keywords
What does this MR do?
This MR introduces only:branches
, only:protected_branches
, only:tags
, only:merge_requests
, only:events
, only:project_paths
. These keywords can be represented as only:refs
, however, it's better to explicitly decouple the concepts for using only/except
keywords more intuitively https://gitlab.com/gitlab-org/gitlab-ce/issues/57075.
Example) Execute a job only when merge requests which associated with a branch named (docs-
) in gitlab projects
only:
merge_requests:
- /(^docs[\/-].*|.*-docs$)/
project_paths:
- gitlab-org/gitlab-ce
- gitlab-org/gitlab-ee
- gitlab/gitlabhq
- gitlab/gitlab-ee
Example) Global only/except (Related: https://gitlab.com/gitlab-org/gitlab-ce/issues/55011)
only:
protected-branches:
- //
tags:
- //
merge_requests:
- //
exactly_one_of: [protected-branches, tags, branches, merge_requests]
What are the relevant issue numbers?
- Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/60178
- Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/57075
- Helps https://gitlab.com/gitlab-org/gitlab-ce/issues/57190
- Helps https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/24880
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated via this MR -
Documentation reviewed by technical writer or follow-up review issue created -
Tests added for this feature/bug -
Tested in all supported browsers -
Conforms to the code review guidelines -
Conforms to the merge request performance guidelines -
Conforms to the style guides -
Conforms to the database guides -
Link to e2e tests MR added if this MR has Requires e2e tests label. See the Test Planning Process. -
Security reports checked/validated by reviewer
Edited by Shinya Maeda