@@ -113,6 +113,24 @@ public void inform(final Event e) {
113
113
final long end = System .currentTimeMillis ();
114
114
LOGGER .info ("GitHub Advisory mirroring complete" );
115
115
LOGGER .info ("Time spent (total): " + (end - start ) + "ms" );
116
+
117
+ if (mirroredWithoutErrors ) {
118
+ Notification .dispatch (new Notification ()
119
+ .scope (NotificationScope .SYSTEM )
120
+ .group (NotificationGroup .DATASOURCE_MIRRORING )
121
+ .title (NotificationConstants .Title .GITHUB_ADVISORY_MIRROR )
122
+ .content ("Mirroring of GitHub Advisories completed successfully" )
123
+ .level (NotificationLevel .INFORMATIONAL )
124
+ );
125
+ } else {
126
+ Notification .dispatch (new Notification ()
127
+ .scope (NotificationScope .SYSTEM )
128
+ .group (NotificationGroup .DATASOURCE_MIRRORING )
129
+ .title (NotificationConstants .Title .GITHUB_ADVISORY_MIRROR )
130
+ .content ("An error occurred mirroring the contents of GitHub Advisories. Check log for details." )
131
+ .level (NotificationLevel .ERROR )
132
+ );
133
+ }
116
134
} else {
117
135
LOGGER .warn ("GitHub Advisory mirroring is enabled, but no personal access token is configured. Skipping." );
118
136
}
@@ -160,24 +178,6 @@ private void retrieveAdvisories(final String advisoriesEndCursor) throws IOExcep
160
178
retrieveAdvisories (pageableList .getEndCursor ());
161
179
}
162
180
}
163
-
164
- if (mirroredWithoutErrors ) {
165
- Notification .dispatch (new Notification ()
166
- .scope (NotificationScope .SYSTEM )
167
- .group (NotificationGroup .DATASOURCE_MIRRORING )
168
- .title (NotificationConstants .Title .GITHUB_ADVISORY_MIRROR )
169
- .content ("Mirroring of GitHub Advisories completed successfully" )
170
- .level (NotificationLevel .INFORMATIONAL )
171
- );
172
- } else {
173
- Notification .dispatch (new Notification ()
174
- .scope (NotificationScope .SYSTEM )
175
- .group (NotificationGroup .DATASOURCE_MIRRORING )
176
- .title (NotificationConstants .Title .GITHUB_ADVISORY_MIRROR )
177
- .content ("An error occurred mirroring the contents of GitHub Advisories. Check log for details." )
178
- .level (NotificationLevel .ERROR )
179
- );
180
- }
181
181
}
182
182
}
183
183
0 commit comments