Need Github username of the user who pushed to a branch

github

#1

This will trigger a container tagged with the user identity which will then be passed to our existing CD system downstream because of reasons. But I have to know who pushed to the branch to do this. How is this information exposed in CircleCI?


#2

The documentation has a section for built-in environment variables:

https://circleci.com/docs/2.0/env-vars/#built-in-environment-variables

The relevant snippet:

CIRCLE_USERNAME	String	The GitHub or Bitbucket username of the user who triggered the build.

#3

You can see all the automatic env vars in a build by opening the run step “Spin up Environment” once it has run.