Skip to content

Commit

Permalink
fix: replace deprecated gitlab ci var
Browse files Browse the repository at this point in the history
GitLab 16.x deprecated several variables including CI_BUILD_REF_NAME.
In order to be exhaustive, two variables are replacing it:
CI_COMMIT_BRANCH (prefered) and CI_COMMIT_REF_NAME.

Issue: iterative#1403
  • Loading branch information
nipierre committed Jul 20, 2023
1 parent 204a5a7 commit 2cbddb7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/drivers/gitlab.js
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,10 @@ class Gitlab {
}

get branch() {
return process.env.CI_BUILD_REF_NAME;
if ('CI_COMMIT_BRANCH' in process.env) {
return process.env.CI_COMMIT_BRANCH
}
return process.env.CI_COMMIT_REF_NAME;
}

get userEmail() {
Expand Down

0 comments on commit 2cbddb7

Please sign in to comment.