File tree Expand file tree Collapse file tree 4 files changed +23
-2
lines changed
src/main/java/tools/devnull/jenkins/plugins/buildnotifications Expand file tree Collapse file tree 4 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ Notifications will include:
2727- The project's name
2828- The build number
2929- The build result
30+ - The build's changes
3031- The build link
3132
3233If you are receiving notifications through Pushover, the notification will be sent with
Original file line number Diff line number Diff line change 11# Changelog
22
3+ ## 1.2.1
4+
5+ - Updated notification with the changes made to the current jenkins build
6+
37## 1.2.0
48
59- Added support for broadcasting notifications through ` boteco `
Original file line number Diff line number Diff line change 1111 </parent >
1212 <groupId >tools.devnull</groupId >
1313 <artifactId >build-notifications</artifactId >
14- <version >1.2.0 </version >
14+ <version >1.2.1 </version >
1515 <packaging >hpi</packaging >
1616
1717 <name >Jenkins Build Notification Plugin</name >
Original file line number Diff line number Diff line change 2828
2929import hudson .model .AbstractBuild ;
3030import hudson .model .Result ;
31+ import hudson .scm .ChangeLogSet ;
3132import jenkins .model .JenkinsLocationConfiguration ;
3233
34+ import java .util .Iterator ;
3335import java .util .logging .Logger ;
3436
3537/**
@@ -90,7 +92,21 @@ private void setUrl() {
9092 }
9193
9294 private void setContent () {
93- message .setContent (result .toString ());
95+ if (build .getChangeSet ().getItems ().length == 0 ){
96+ message .setContent (result .toString ());
97+ } else {
98+ StringBuilder changes = new StringBuilder ();
99+
100+ for (Iterator <? extends ChangeLogSet .Entry > i = build .getChangeSet ().iterator (); i .hasNext ();) {
101+ ChangeLogSet .Entry change = i .next ();
102+ changes .append ("\n " );
103+ changes .append (change .getMsg ());
104+ changes .append (" - " );
105+ changes .append (change .getAuthor ());
106+ }
107+
108+ message .setContent (String .format ("%s%n%s" , result .toString (), changes .toString ()));
109+ }
94110 }
95111
96112 private void setTitle () {
You can’t perform that action at this time.
0 commit comments