Skip to content

Commit

Permalink
Merge pull request #710 from codecov/gitlab-envvar-support-ci-mr-pipe…
Browse files Browse the repository at this point in the history
…line

Use CI_MERGE_REQUEST_SOURCE_BRANCH_SHA for GitLab CI
  • Loading branch information
mitchell-codecov authored Apr 12, 2022
2 parents 7177c6a + f057517 commit 067196b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ci_providers/provider_gitlabci.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export function getServiceName(): string {

function _getSHA(inputs: UploaderInputs): string {
const { args, environment: envs } = inputs
return args.sha || envs.CI_BUILD_REF || envs.CI_COMMIT_SHA || ''
return args.sha || envs.CI_MERGE_REQUEST_SOURCE_BRANCH_SHA || envs.CI_BUILD_REF || envs.CI_COMMIT_SHA || ''
}

function _getSlug(inputs: UploaderInputs): string {
Expand Down Expand Up @@ -75,6 +75,7 @@ export function getEnvVarNames(): string[] {
'CI_COMMIT_REF_NAME',
'CI_COMMIT_SHA',
'CI_JOB_ID',
'CI_MERGE_REQUEST_SOURCE_BRANCH_SHA',
'CI_PROJECT_PATH',
'CI_REPOSITORY_URL',
'GITLAB_CI',
Expand Down

0 comments on commit 067196b

Please sign in to comment.