What's publishHtml reportFiles parameter syntax

If you have several HTML files but do not know their name nor count in advance, you can do such code:

script {
    def htmlFiles
    dir ('reports') {
        htmlFiles = findFiles glob: '*.html'
    }
    publishHTML([
            reportDir: 'reports',
            reportFiles: htmlFiles.join(','),
            reportName: 'Newman Collection Results',
            allowMissing: true,
            alwaysLinkToLastBuild: true,
            keepAll: true])
}

Notice the script section as Jenkins does not allow to declare variable in stage or steps section.


"you can specify multiple comma-separated pages and each will be a tab on the report page" (from the plugin docs).

so i think it's:

reportFiles: 'test.html,other.html'

can it support wildcards like *.html? no, but there are some workarounds at https://issues.jenkins-ci.org/browse/JENKINS-7139.