Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to pass the real user in TeamCity VCS trigger instead of just "Git"

I have in my TeamCity job a VCS trigger that runs automatically once we push changes in our bitbucket repo. that looks like this:

Quiet period: 60 seconds (default)
VCS trigger rules:
-:user=ciuser:**/*
Triggers one build per each VCS check-in (include several check-ins in build if they are from the same committer)

now when checking the %teamcity.build.triggeredBy% parameter Im getting as a result the string "Git" instead of actually the user that pushed those changes.

is there a way to get the username that made the changes instead of getting that git parameter.

I searched here and didn't find any answer and didn't find any relevant question in stack overflow either.

like image 312
yonBav Avatar asked Nov 17 '25 14:11

yonBav


1 Answers

The %teamcity.build.triggeredBy% parameter is not populated with the user that pushed the changes to git - according to the docs, it's simply:

Human-friendly description of how the build was triggered

Thus, the value Git indicates that the build was triggered by the fact that new commits were pushed to the Git repository, which is configured as VCSRoot for this project.

There is no easy way to obtain the information you need. There are a couple of options outlined in this post:

  • use TeamCity REST API
  • use Git command-line tool
like image 157
Yan Sklyarenko Avatar answered Nov 19 '25 03:11

Yan Sklyarenko



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!