How to get SHA of commit for Xcode Bot "Run Script" Trigger? Updating status of tests on Github

I am using this code in my Xcode Bot triggers to get the SHA of the commit:

git -C ${XCS_SOURCE_DIR}/name_of_your_git_repo rev-parse HEAD

And this to get the branch name:

git -C ${XCS_SOURCE_DIR}/name_of_your_git_repo rev-parse --abbrev-ref HEAD

This executes a git command in the source directory, replace "name_of_your_git_repo" by the name of your repository on git