how to get SHA of head of the branch in github code example
Example: get the latest git commit SHA-1 in a repository js
require('child_process').exec('git rev-parse HEAD', function(err, stdout) {
console.log('Last commit hash on this branch is:', stdout);
});