jenkinsci/git-changelog-plugin

2.20 not rendering html on the build page

Closed this issue · 3 comments

Hello. I created stage for changelog page, but html template not rendering.
Plugin version 2.20

pipeline {
    agent { label 'agent' }
    stages {
        stage('build'){
            steps {
                echo 'build'
            }  
        }
        stage('update commits') {
            steps {
                script {
                    def changelogString = gitChangelog returnType: 'STRING',
                        from: [type: 'REF', value: 'staging'],
                        to: [type: 'REF', value: 'master'],
                        template: """
                                <h1> Git Changelog changelog </h1>

                                <p>
                                Changelog of Git Changelog.
                                </p>
                                
                                {{#tags}}
                                <h2> {{name}} </h2>
                                 {{#issues}}
                                  {{#hasIssue}}
                                   {{#hasLink}}
                                <h2> {{name}} <a href="{{link}}">{{issue}}</a> {{title}} </h2>
                                   {{/hasLink}}
                                   {{^hasLink}}
                                <h2> {{name}} {{issue}} {{title}} </h2>
                                   {{/hasLink}}
                                  {{/hasIssue}}
                                  {{^hasIssue}}
                                <h2> {{name}} </h2>
                                  {{/hasIssue}}
                                
                                
                                   {{#commits}}
                                <a href="https://github.com/user/repo/commit/{{hash}}">{{hash}}</a> {{authorName}} <i>{{commitTime}}</i>
                                <p>
                                <h3>{{{messageTitle}}}</h3>
                                
                                {{#messageBodyItems}}
                                 <li> {{.}}</li> 
                                {{/messageBodyItems}}
                                </p>
                                

                                  {{/commits}}
                                
                                 {{/issues}}
                                {{/tags}}
                                """
                    currentBuild.description = changelogString
                }
            }
         }
    }
}

Screenshot 2019-10-27 at 12 26 48

Screenshot 2019-10-27 at 12 28 29

You need to enable html rendering in jenkins global security settings

Closing because it is not related to the plugin.

Thanks a lot! It's work.
Screenshot 2019-10-27 at 12 36 34