Fetching github commit username

Is there an environment variable that lists the GitHub username of the commit that triggers a Bitrise build? Note that this is not referring to the Git name but rather the username of a Github account. I don’t see it as part of the available environment variables (Available environment variables | Bitrise DevCenter).
If there is no way of accessing this directly via an env variable is it possible to access the webhook payload in order to extract this information directly?

Hi Swaraj,

Thank you for contacting Bitrise support!

Our Git Clone step exposes the env var $GIT_CLONE_COMMIT_AUTHOR_NAME as well as $GIT_CLONE_COMMIT_COMMITER_NAME. You can see all env vars exposed by this step here:

These should expose the Github username for both the author and committer. Please let me know if you have further questions!

Kind regards,
Allene

Thank you! Can you link me to where this is listed in the docs for future reference?

It’s not technically listed in our docs, but rather under the step in your workflow (this step is automatically applied in all workflows as it clones your repo to our VMs). You can read more about the step here.

Here is an image of the full workflow and step:

Please let me know if it is alright to close this ticket :grinning_face_with_smiling_eyes:

Kind regards,
Allene​

Gotcha, thanks for the quick response!

Hi again, turns out GIT_CLONE_COMMIT_COMMITER_NAME is actually set to the Git username instead of the Github username. GIT_CLONE_AUTHOR_NAME is unset on branch builds and is set to “GitHub” on merge builds.

Hello @swarajrao :wave:

Just to confirm, could you let me know if you still need assistance? :slight_smile:

Thanks for following up - this was addressed in another thread, I’m working on opening a PR directly to the Bitrise webhook repository for review.

Thanks for the confirmation, @swarajrao, that’s excellent news! :slight_smile:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.