Commit 896e5f50 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Merge branch '26692-predefined-variable-gitlab-user-name' into 'master'

Resolve "Predefined Variable GITLAB_USER_NAME"

Closes #26692

See merge request !13824
parents bf51ab88 22d5cca8
...@@ -387,7 +387,9 @@ module Ci ...@@ -387,7 +387,9 @@ module Ci
[ [
{ key: 'GITLAB_USER_ID', value: user.id.to_s, public: true }, { key: 'GITLAB_USER_ID', value: user.id.to_s, public: true },
{ key: 'GITLAB_USER_EMAIL', value: user.email, public: true } { key: 'GITLAB_USER_EMAIL', value: user.email, public: true },
{ key: 'GITLAB_USER_LOGIN', value: user.username, public: true },
{ key: 'GITLAB_USER_NAME', value: user.name, public: true }
] ]
end end
......
---
title: Add CI/CD job predefined variables with user name and login
merge_request: 13824
author:
type: added
...@@ -78,6 +78,8 @@ future GitLab releases.** ...@@ -78,6 +78,8 @@ future GitLab releases.**
| **GITLAB_CI** | all | all | Mark that job is executed in GitLab CI environment | | **GITLAB_CI** | all | all | Mark that job is executed in GitLab CI environment |
| **GITLAB_USER_ID** | 8.12 | all | The id of the user who started the job | | **GITLAB_USER_ID** | 8.12 | all | The id of the user who started the job |
| **GITLAB_USER_EMAIL** | 8.12 | all | The email of the user who started the job | | **GITLAB_USER_EMAIL** | 8.12 | all | The email of the user who started the job |
| **GITLAB_USER_LOGIN** | 10.0 | all | The login username of the user who started the job |
| **GITLAB_USER_NAME** | 10.0 | all | The real name of the user who started the job |
| **RESTORE_CACHE_ATTEMPTS** | 8.15 | 1.9 | Number of attempts to restore the cache running a job | | **RESTORE_CACHE_ATTEMPTS** | 8.15 | 1.9 | Number of attempts to restore the cache running a job |
## 9.0 Renaming ## 9.0 Renaming
......
...@@ -1257,8 +1257,12 @@ describe Ci::Build do ...@@ -1257,8 +1257,12 @@ describe Ci::Build do
context 'when build has user' do context 'when build has user' do
let(:user_variables) do let(:user_variables) do
[{ key: 'GITLAB_USER_ID', value: user.id.to_s, public: true }, [
{ key: 'GITLAB_USER_EMAIL', value: user.email, public: true }] { key: 'GITLAB_USER_ID', value: user.id.to_s, public: true },
{ key: 'GITLAB_USER_EMAIL', value: user.email, public: true },
{ key: 'GITLAB_USER_LOGIN', value: user.username, public: true },
{ key: 'GITLAB_USER_NAME', value: user.name, public: true }
]
end end
before do before do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment