ci: Add workflow rules to control merge request pipelines
Prevent automatic merge request pipelines unless UTOOL_TRIGGER=1 is set. This allows utool to create controlled pipelines with specific CI variables while preventing duplicate automatic pipelines.
This commit is contained in:
@@ -3,6 +3,18 @@
|
||||
include:
|
||||
- local: '.gitlab-ci-release.yml'
|
||||
|
||||
# Control when pipelines are created
|
||||
workflow:
|
||||
rules:
|
||||
# Allow manual merge request pipelines when MANUAL_TRIGGER is set
|
||||
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $MANUAL_TRIGGER == "1"'
|
||||
when: always
|
||||
# Prevent automatic merge request pipelines
|
||||
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
|
||||
when: never
|
||||
# Allow all other pipeline sources (push, manual, API)
|
||||
- when: always
|
||||
|
||||
variables:
|
||||
DEFAULT_TAG: ""
|
||||
MIRROR_DOCKER: docker.io
|
||||
|
||||
Reference in New Issue
Block a user