diff --git a/.github/workflows/gitlab.yml b/.github/workflows/gitlab.yml index 56b455fb8..a66e7d61c 100644 --- a/.github/workflows/gitlab.yml +++ b/.github/workflows/gitlab.yml @@ -28,7 +28,7 @@ jobs: ; user.password = '${{ github.token }}' ; user.password_confirmation = '${{ github.token }}' ; user.save! - ; token = user.personal_access_tokens.create(scopes: [:api], name: 'Token') + ; token = user.personal_access_tokens.create(scopes: [:api], name: 'Token', expires_at: 1.days.from_now) ; token.set_token('${{ github.token }}') ; token.save! " diff --git a/src/drivers/gitlab.js b/src/drivers/gitlab.js index f5cb6a7df..932964ea6 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() {