Commit 91cca6e4 authored by Mark Fletcher's avatar Mark Fletcher

Add a Build Variable to represent the triggering GitLab user's name

* Predefined variable represents the name of the GitLab user that started a build
parent 19dfd9e9
...@@ -384,7 +384,8 @@ module Ci ...@@ -384,7 +384,8 @@ 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_NAME', value: user.name, public: true }
] ]
end end
......
...@@ -77,6 +77,12 @@ future GitLab releases.** ...@@ -77,6 +77,12 @@ 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 |
<<<<<<< HEAD
| **GITLAB_USER_NAME** | 10.0 | all | The name of the user who started the job |
=======
| **GITLAB_USER_USERNAME** | 10.0 | all | The username of the user who started the job |
| **GITLAB_USER_NAME** | 10.0 | all | The real name of the user who started the job |
>>>>>>> 940c584882... fixup name
| **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
......
...@@ -1247,8 +1247,11 @@ describe Ci::Build do ...@@ -1247,8 +1247,11 @@ 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_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