test on merge event rather than branch name master as a fork could also have a branch master

This commit is contained in:
Marcel Märtens 2021-07-08 11:27:44 +02:00
parent fcc6bb819b
commit 6efe3523d5
2 changed files with 4 additions and 4 deletions

View File

@ -1,7 +1,7 @@
# Template to only run if actual changes has been made to the code and not just documentation
.recompile-branch:
rules:
- if: $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
# No '-' here is *very* important: https://docs.gitlab.com/ee/ci/yaml/#complex-rule-clauses
changes:
- "**/*.{glsl,png,rs,ron,toml,vox,yml,wav}"

View File

@ -2,7 +2,7 @@
.optional-release:
stage: check
rules:
- if: $CI_PIPELINE_SOURCE == "schedule" || $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+/ || $CI_COMMIT_REF_NAME =~ /^r[0-9]+\.[0-9]+/
- if: $CI_PIPELINE_SOURCE != "merge_request_event" || $CI_PIPELINE_SOURCE == "schedule" || $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+/ || $CI_COMMIT_REF_NAME =~ /^r[0-9]+\.[0-9]+/
when: never
- when: manual
allow_failure: true
@ -11,7 +11,7 @@
.release:
stage: build
rules:
- if: $CI_PIPELINE_SOURCE != "schedule" && ($CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+/ || $CI_COMMIT_REF_NAME =~ /^r[0-9]+\.[0-9]+/)
- if: $CI_PIPELINE_SOURCE != "merge_request_event" && $CI_PIPELINE_SOURCE != "schedule" && ($CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+/ || $CI_COMMIT_REF_NAME =~ /^r[0-9]+\.[0-9]+/)
when: always
- when: never
@ -19,6 +19,6 @@
.release-nightly-tmp-fix-airshipper:
stage: build-nightly
rules:
- if: $CI_PIPELINE_SOURCE == "schedule" && ($CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+/ || $CI_COMMIT_REF_NAME =~ /^r[0-9]+\.[0-9]+/)
- if: $CI_PIPELINE_SOURCE != "merge_request_event" && $CI_PIPELINE_SOURCE == "schedule" && ($CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+/ || $CI_COMMIT_REF_NAME =~ /^r[0-9]+\.[0-9]+/)
when: always
- when: never