jessehouwing / azure-pipelines-tfvc-tasks

Azure Pipelines tasks for Team Foundation Version Control
https://marketplace.visualstudio.com/items?itemName=jessehouwing.jessehouwing-vsts-tfvc-tasks
MIT License
28 stars 17 forks source link

Build Number in check-in comments #76

Closed dbman86 closed 5 years ago

dbman86 commented 5 years ago

I Would like to use the build number (which we change during the pipeline) in the check-in comments - but nothing seems to work - they all say NO_CI - using Link Settings - but it's always pre-pending Parameters at the front so not sure that tried Parameters.BuildNumber, Parameters.Build.BuildNumber, etc.

image

how can I do this?

Also ideally I would be able to add other text in addition to the build number but not 100% necessary ("Checkin for build ... ")

thanks for making this!

jessehouwing commented 5 years ago

Use one of my other tasks, the set variable tasks from the variable toolkit to set the correct comment format. Then link the required input parameters to that.

dbman86 commented 5 years ago

thanks for quick reply - tried that but not working - I guess I need to use a different parameter or specify it differently? thanks

image

image

jessehouwing commented 5 years ago

That way you shouldn't need to link anything, it's taking all parameters from context.

On Sun, 13 Jan 2019, 21:15 santoorman <notifications@github.com wrote:

thanks for quick reply - tried that but not working - I guess I need to use a different parameter or specify it differently? thanks

[image: image] https://user-images.githubusercontent.com/629163/51090184-ef29ba80-172c-11e9-876c-cc35fe9ed9d3.png

[image: image] https://user-images.githubusercontent.com/629163/51090182-e802ac80-172c-11e9-9ebf-7c0c0a6e97ec.png

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jessehouwing/vsts-tfvc-tasks/issues/76#issuecomment-453861836, or mute the thread https://github.com/notifications/unsubscribe-auth/AD-uS9eLMjX0V5vxFkYi-JAyZbAZ0iTtks5vC5PtgaJpZM4Z8d1Z .

dbman86 commented 5 years ago

OK thanks well why are my checkin comments NO_CI -- something does not appear to be correct.... thanks..

jessehouwing commented 5 years ago

That comment is auto-appended by the task if the settings are to prevent new CI builds to trigger: https://github.com/jessehouwing/vsts-tfvc-tasks/blob/master/vsts-tfvc-checkin/TfvcCheckin.ps1#L214-L225

But it should be appended to your comment.

jessehouwing commented 5 years ago

Why are you using the "Link" option anyway and not just put the comment directly into the Checkin task?

dbman86 commented 5 years ago

because I want to put the actual BuildNumber in the checkin comment... is there an easier way to do this? thanks

jessehouwing commented 5 years ago

Just edit the checkin Comment textbox on the checkin task directly and use the standard variable syntax, just like you did in the set variable task. No need for any linking, those are for linking to variable sets and task groups.

dbman86 commented 5 years ago

Oh Okay thanks, much appreciated.