I really like things to collect the current branch name and git hash at build time. Unfortunately, no, you cannot run these git commands during build with the validation mode installed on the server. You need to change the scan mode to create the agent to ensure that the .git folder exists in the working directory. Upstairs, I see no harm in this. It does not copy remotes, so it would be very difficult for the build agent to make changes to the main repository.
At @hexct, rebase or merge or any number of things can make this account unreliable. Better bind yourself to the git hash than to the # of commits.
source share