Reputation: 87
I have a build pipeline in Azure DevOps which commits a change to a Git repository in my DevOps project. I've been able to get this to work by following these instructions, and this includes adding the following to tell Git whose name should be associated with the commit:
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
I would like this to be committed under the name of the project level build service - the identity whose permissions are inherited when the build runs. The name of this identity follows the format "<project name> Build Service (<organization name>)".
I'd rather not hard code this in the pipeline in case it ever changes, so my question is: how can this name be retrieved and used as a variable within the pipeline?
Thanks in advance.
Upvotes: 0
Views: 3059
Reputation: 31023
Unfortunately, there is no way to get the name of project build service from pipeline by default. When you create a new project, the project build service account will created automatically. Then you could find the service account as a member in Security Service Group in organization settings if it not be deleted. Generally, this account won't change.
Upvotes: 1
Reputation: 41565
You can have the variables Build.QueuedBy
and Build.QueuedById
, it always will be the system identity, for example: [DefaultCollection]\Project Collection Service Accounts
.
You can find here more info.
Upvotes: 0