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) {
180180 $ nrSection = false ;
181181 $ fixSection = false ;
182182 $ 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 );
184189 foreach ($ changeLog as $ index => $ line ) {
185190 if ($ line === '## NOT RELEASED ' ) {
186191 $ nrSection = true ;
@@ -192,16 +197,17 @@ foreach ($services as $service => $hasChange) {
192197 if (strpos ($ line , '## ' ) === 0 ) {
193198 break ;
194199 }
200+ if (strpos ($ line , '### ' ) === 0 && array_search ($ line , $ fixSectionOrder ) > $ fixSectionIndex ) {
201+ break ;
202+ }
203+
195204 if ($ line === $ fixSectionLabel ) {
196205 $ fixSection = true ;
197206 continue ;
198207 }
199208 if (!$ fixSection ) {
200209 continue ;
201210 }
202- if (strpos ($ line , '### ' ) === 0 ) {
203- break ;
204- }
205211
206212 if ($ line !== '' && false !== $ index = array_search ($ line , $ newLines , true )) {
207213 array_splice ($ newLines , $ index , 1 );
You can’t perform that action at this time.
0 commit comments