Hi,
I'm using Stash 2.8 with external-hook add-on, which can enable to run a external script successfully. But, I cannot know how I use positional parameters.
Actually, I want to pass the sha1 hash, branch name and user name as a parameter of the external script. Could you guide to do this?
Hi Hayoung,
That's actually the first I've seen of that plugin. Looking at the code it looks like it's passing in (in order) from hash, to hash, ref id (branch). You should be able to get them via $1, $2 and $3 in your script?
Unfortunately it doesn't look like they're passing in the current user. There isn't much I can do there, you would have to leave a message on the marketplace page. If you manually install raw scripts in the repository pre/post-receive.d hooks directories then Stash will also have set the $REMOTE_USER environment variable which contains the current username.
Generally we recommending using our more powerful Stash hooks, which have access to all this information (and more), although it does mean writing Java.
Cheers,
Charles
Thank you very much~
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi!
Maintaner here. Charles was perfectly correct about positional paramers and user name.
I've updated documentation to make clear how to pass arguments.
Also, I've released new version that have possibility of passing user name and email in special environment variables named $STASH_USER_NAME and $STASH_USER_EMAIL.
Stanislav.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Stanislav,
I can't seem to find the documentation for the positional parameters. Can you please paste a link here to them? Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.