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

* Predefined variable represents the username of the GitLab user that started a build
This commit is contained in:
Mark Fletcher 2017-08-25 11:01:55 +07:00
parent 91cca6e494
commit 22d5cca8a7
4 changed files with 8 additions and 5 deletions

View file

@ -385,6 +385,7 @@ module Ci
[
{ 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

View file

@ -0,0 +1,5 @@
---
title: Add CI/CD job predefined variables with user name and login
merge_request: 13824
author:
type: added

View file

@ -77,12 +77,8 @@ future GitLab releases.**
| **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_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_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 |
>>>>>>> 940c584882... fixup name
| **RESTORE_CACHE_ATTEMPTS** | 8.15 | 1.9 | Number of attempts to restore the cache running a job |
## 9.0 Renaming

View file

@ -1250,6 +1250,7 @@ describe Ci::Build do
[
{ 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