1.安装插件,该插件jenkins未提供,在git上找的
下载地址:https://github.com/KrisMarko/kr-changelog
下载后,自行安装到jenkins
image.png
2. 构建环境中配置参数
安装完插件后,构建环境选项中会多出Add Changelog Information to Environment 选项
image.png
3. 选中Add Changelog Information to Environment 选项,配置参数
image.png
4. 通过 ${SCM_CHANGELOG} 使用
image.png