Problem to solve
We know that a CI_PIPELINE_SOURCE=merge_request_event
pipeline is created in two scenarios (at least). One when an MR is created and another when a push commit is made to an open MR.
We need a solution to tell if the merge_request_event
pipeline belongs to creating an MR or to a push to an existing open MR? Looking at the env vars in the jobs, there is no obvious one that can provide this information.
I was hoping these variables help, but they are identical in both pipelines:
CI_PIPELINE_SOURCE == merge_request_event
CI_COMMIT_BRANCH == null
CI_OPEN_MERGE_REQUESTS != null
CI_COMMIT_BEFORE_SHA = 0000000000000000000000000000000000000000
CI_MERGE_REQUEST_ID != null
Version: 17.0.2
Git revision: 8ad74cf9
Git branch: 17-0-stable
GO version: go1.21.9
Built: 2024-07-25T17:34:34+0000
OS/Arch: linux/amd64