CloudBuild GitHub app: How to get Git revision and branch from script in step?

108 views
Skip to first unread message

Gus Narea

unread,
Aug 1, 2019, 1:23:30 PM8/1/19
to Google Cloud Developers

Hello,

I'm using the GitHub app (https://github.com/apps/google-cloud-build) and I'd like to access the Git revision and the Git branch from a script run by a step. How can I do that? 

I already checked the environment variables and there's nothing there. Also, the working directory isn't a Git repo (there's no .git directory). Is there a file I can read or an HTTP endpoint I can call to get the information I need?

Cheers,

Gus.

Elliott (Google Cloud Platform Support)

unread,
Aug 1, 2019, 4:07:48 PM8/1/19
to Google Cloud Developers

Hello Gus,


Please note that Google Groups are reserved for general Google Cloud Platform-end product discussions and not for technical issues, which is why I suggest moving the troubleshooting to Stackoverflow, where you may receive advice from our programming community.


Reply all
Reply to author
Forward
0 new messages