From 2cbddb7a7762cc165a27ad81e0b163e0711e1935 Mon Sep 17 00:00:00 2001 From: nipierre Date: Thu, 20 Jul 2023 18:06:26 +0200 Subject: [PATCH] fix: replace deprecated gitlab ci var 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: #1403 --- src/drivers/gitlab.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/drivers/gitlab.js b/src/drivers/gitlab.js index f5cb6a7df..92b21f9b1 100644 --- a/src/drivers/gitlab.js +++ b/src/drivers/gitlab.js @@ -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() {