grunt-build-control icon indicating copy to clipboard operation
grunt-build-control copied to clipboard

Allow for tokens in branch name

Open micahgodbolt opened this issue 10 years ago • 0 comments

I'd like to be able to pass the sourceBranch token into the branch name so that pushes made from the 1.2.0 branch get pushed to the 1.2.0 remote branch.

branch: '%sourceBranch%',

I can easily replicate the functionality by reusing this replace function down in the try section, but i'm guessing there might be a more complete way to do this? Is there value in supporting all of the tokens in the branch name? How about the tag name? Should we create a reusable function where we can pass a string and have it 'tokenized'.

options.branch = options.branch.replace(/%sourceBranch%/g, tokens.branch);

micahgodbolt avatar Dec 09 '14 00:12 micahgodbolt