Wrong GITLAB_USER_LOGIN and GITLAB_USER_NAME in pipeline jobs
# This is a minimal example showing how the gitlab ci user variables gets wrong
# if you trigger this pipeline with user A and then have a user B press the manual step in stage2.
# Observe that stage3 says Approved by user A and not user B as expected :(
# Both users need to be a member of the project
image: docker:latest
services:
- docker:dind
stages:
- stage1
- stage2
- stage3
stage-1:
stage: stage1
script:
- echo "Approved by ${GITLAB_USER_LOGIN}, ${GITLAB_USER_NAME}"
stage-2:
stage: stage2
script:
- echo "Approved by ${GITLAB_USER_LOGIN}, ${GITLAB_USER_NAME}"
when: manual
allow_failure: false
stage-3:
stage: stage3
script:
- echo "Approved by ${GITLAB_USER_LOGIN}, ${GITLAB_USER_NAME}"