Duplicate CI pipelines for renovate-runner self-updates
Hi,
I noticed our self-hosted renovate-runner based on this repository creating two pipelines per renovate branch/MR in the renovate-runner project and I think I tracked it down to this line in .gitlab-ci.yml: https://gitlab.com/renovate-bot/renovate-runner/-/blob/main/.gitlab-ci.yml?ref_type=heads#L20
The CI_COMMIT_BRANCH variable is "Not available in merge request pipelines or tag pipelines." 1, I think the CI_MERGE_REQUEST_SOURCE_BRANCH_NAME is the correct variable to use here instead?
workflow:
rules:
# Don't build push pipeline when open MR and not renovate branch
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS && $CI_COMMIT_BRANCH !~ /^renovate\//
when: never
# Don't build MR pipeline when renovate branch
- - if: $CI_PIPELINE_SOURCE == "merge_request_event" && $CI_COMMIT_BRANCH =~ /^renovate\//
+ - if: $CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME =~ /^renovate\//
when: never
# Don't build tags
- if: $CI_COMMIT_TAG
when: never
- when: always