# Rules for where jobs can run
.run_automatically:
rules:
# Release jobs ignore MRs.
- if: '$CI_MERGE_REQUEST_ID && $IS_FOR_RELEASE == "true"'
when: never
- if: '$CI_MERGE_REQUEST_ID'
when: on_success
# Non-protected branches without tags should be skipped.
- if: '$CI_COMMIT_REF_PROTECTED != "true" && $CI_COMMIT_TAG == ""'
when: never
# Run everything for tags.
- if: '$CI_PROJECT_PATH == "utils/rust-gitlab" && $CI_COMMIT_TAG'
when: on_success
# Skip release-only jobs.
- if: '$CI_PROJECT_PATH == "utils/rust-gitlab" && $IS_FOR_RELEASE == "true"'
when: never
# Run everything on the main project.
- if: '$CI_PROJECT_PATH == "utils/rust-gitlab"'
when: on_success
- when: never