Allow use of `when` with `rules`
What does this MR do and why?
Allows the use of when
with rules
.
Note: This is NOT a breaking change as it's not changing the existing functionality, it is a feature enhancement.
Screenshots or screen recordings
How to set up and validate locally
Test with any of the following config files.
job-with-rules:
script: 'echo hey'
rules:
- if: $CI_COMMIT_REF_NAME =~ /master/
With a matching rule: when: on_success
job-when-with-rules:
script: 'echo hey'
when: manual
rules:
- if: $CI_COMMIT_REF_NAME =~ /master/
With a matching rule: when: manual
job-when-with-rules-when:
script: 'echo hey'
when: manual
rules:
- if: $CI_COMMIT_REF_NAME =~ /master/
when: on_success
With a matching rule: when: on_success
job-with-rules-when:
script: 'echo hey'
rules:
- if: $CI_COMMIT_REF_NAME =~ /master/
when: manual
With a matching rule: when: manual
job-without-rules:
script: 'echo this is a job with NO rules'
With a matching rule: when: on_success
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Laura Montemayor