In Jenkins, how do builds know who requested them?

后端 未结 6 1135
南旧
南旧 2021-01-04 01:09

I need to pass the username of the requestor of a build down to the script that is actually doing the work. Looking at the console output for a particular build, the first

6条回答
  •  一向
    一向 (楼主)
    2021-01-04 01:13

    In your Job add "Execute system Groovy script":

    def yourUserName = build.causes[0].userId
    

提交回复
热议问题