Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 98b87bf7 authored by Jonathan Klee's avatar Jonathan Klee
Browse files

ci: restrict automatic release jobs to protected refs

parent 293c4810
Loading
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -35,15 +35,21 @@ before_script:

.rules_merge_request_ref:
  rules: &rules_merge_request_ref
    - if: "$CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS"
    - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS'
      when: never
    - when: always

.rules_protected_ref:
  rules: &rules_protected_ref
    - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS'
      when: never
    - if: '$CI_COMMIT_REF_PROTECTED == "true"'
      when: always
    - if: "$CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS"
    - when: manual

.rules_manual_ref:
  rules: &rules_manual_ref
    - if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS'
      when: never
    - when: manual

@@ -87,6 +93,7 @@ before_script:

build-release:
  extends: .build
  rules: *rules_protected_ref
  allow_failure: false
  cache:
    key: ${CI_PROJECT_ID}
@@ -125,7 +132,7 @@ build-debug:

generate-apks:
  stage: build
  rules: *rules_protected_ref
  rules: *rules_manual_ref
  allow_failure: true
  needs:
    - job: build-release