The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How do I retrieve --push-option arguments in postReceive() of a Bitbucket Git hook?

unbrokenrabbit
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 17, 2018

I'm implementing a post-receive Git hook using Bitbucket's SDK.  I'm trying to retrieve the --push-option argument(s) that are passed via a call to git push (ie git push origin master --push-option=something), but I'm not having any luck in figuring out how these are made available to me via the RepositoryHookContext and collection of RefChange objects that are passed into the postReceive() method in the Bitbucket SDK.  If I were implementing a Git hook script directly my understanding is that I could retrieve the --push-option argument count via the GIT_PUSH_OPTION_COUNT environment variable, and then the actual --push-option argument values via GIT_PUSH_OPTION_0, GIT_PUSH_OPTION_1, etc environment variables.  I'm at a loss though as to how to retrieve this information from within the Bitbucket SDK.  Any help would be greatly appreciated.

0 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events