vsts - Reference commit message in VS Team Services -


i have release definition associated build definition in vs team services.

in task of release definition need commit message of changes associated corresponding build.

how it? there variable can directly?

there no pre-defined variable this. can add powershell script task , use following code commit message via rest api(you need enable alternative credential code):

[string]$buildid = "$env:build_buildid" [string]$project = "$env:system_teamproject" [string]$projecturi = "$env:system_teamfoundationcollectionuri"  $username="alternativeusername" $password="alternativepassword"  $basicauth= ("{0}:{1}"-f $username,$password) $basicauth=[system.text.encoding]::utf8.getbytes($basicauth) $basicauth=[system.convert]::tobase64string($basicauth) $headers= @{authorization=("basic {0}"-f $basicauth)}  $url= $projecturi + $project + "/_apis/build/builds/" + $buildid + "/changes?api-version=2.0"  $responsebuild = invoke-restmethod -uri $url -headers $headers -method | select value  foreach ($change in $responsebuild.value) {     $commitmessage = $change.message     write-host $commitmessage } 

Popular posts from this blog

Apache NiFi ExecuteScript: Groovy script to replace Json values via a mapping file -

python 3.x - PyQt5 - Signal : pyqtSignal no method connect -