@@ -124,11 +124,11 @@ task deploy(type: Copy) {
124124 into ' gocd/server/plugins/external'
125125}
126126
127- static def getLatestTag (boolean isExperimental ) {
127+ static def getLastTag (boolean isExperimental ) {
128128 try {
129129 def command = [" git" , " describe" , " --tags" , " --abbrev=0" ]
130130 if (! isExperimental) {
131- command. add(command. size() - 1 , ' --exclude=" *-exp" ' )
131+ command. add(command. size() - 1 , ' --exclude=*-exp' )
132132 }
133133
134134 def process = command. join(" " ). execute()
@@ -172,7 +172,7 @@ static String readableFileSize(long size) {
172172task previewGithubRelease () {
173173 doLast {
174174 def prerelease = ! " No" . equalsIgnoreCase(System . getenv(' PRERELEASE' ))
175- def lastTag = getLatestTag (prerelease)
175+ def lastTag = getLastTag (prerelease)
176176 def repo = ' docker-swarm-elastic-agents'
177177 def targetCommitish = project. gitRevision
178178 def assets = jar. outputs. files. files
@@ -232,8 +232,9 @@ github {
232232 prerelease = ! " No" . equalsIgnoreCase(System . getenv(' PRERELEASE' ))
233233 tagName = " ${ project.fullVersion}${ prerelease ? '-exp' : ''} "
234234 name = " ${ prerelease ? 'Experimental: ' : ''}${ project.fullVersion} "
235- def tag = getLatestTag(prerelease)
236- def changelogHeader = tag ? " ### Changelog ${ tag} ..${ project.gitRevision.substring(0, 7)} " : " ### Changelog"
237-
238- body = """ \n ${ changelogHeader} \n\n ${ getCommitsSinceLastTag(tag).replaceAll("\"", "")} \n """ . stripIndent(). trim()
235+ def lastTag = getLastTag(prerelease)
236+ def changelogHeader = lastTag ? " ### Changelog ${ lastTag} ..${ project.gitRevision.substring(0, 7)} " : " ### Changelog"
237+ def changeLog = getCommitsSinceLastTag(lastTag). replaceAll(" \" " , " " )
238+
239+ body = """ \n $changelogHeader \n\n ${ changeLog} \n """ . stripIndent(). trim()
239240}
0 commit comments