File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -180,7 +180,12 @@ foreach ($services as $service => $hasChange) {
180
180
$ nrSection = false ;
181
181
$ fixSection = false ;
182
182
$ fixSectionLabel = $ hasChange ? '### Added ' : '### Changed ' ;
183
-
183
+ $ fixSectionOrder = [
184
+ '### BC-BREAK ' , '### Removed ' , // Major
185
+ '### Added ' , '### Deprecated ' , // Minor
186
+ '### Changed ' , '### Fixed ' , '### Security ' , // Patch
187
+ ];
188
+ $ fixSectionIndex = array_search ($ fixSectionLabel , $ fixSectionOrder );
184
189
foreach ($ changeLog as $ index => $ line ) {
185
190
if ($ line === '## NOT RELEASED ' ) {
186
191
$ nrSection = true ;
@@ -192,16 +197,17 @@ foreach ($services as $service => $hasChange) {
192
197
if (strpos ($ line , '## ' ) === 0 ) {
193
198
break ;
194
199
}
200
+ if (strpos ($ line , '### ' ) === 0 && array_search ($ line , $ fixSectionOrder ) > $ fixSectionIndex ) {
201
+ break ;
202
+ }
203
+
195
204
if ($ line === $ fixSectionLabel ) {
196
205
$ fixSection = true ;
197
206
continue ;
198
207
}
199
208
if (!$ fixSection ) {
200
209
continue ;
201
210
}
202
- if (strpos ($ line , '### ' ) === 0 ) {
203
- break ;
204
- }
205
211
206
212
if ($ line !== '' && false !== $ index = array_search ($ line , $ newLines , true )) {
207
213
array_splice ($ newLines , $ index , 1 );
You can’t perform that action at this time.
0 commit comments