@@ -702,36 +702,39 @@ public function processChangelog()
702702 if ($ token ) {
703703 $ client ->authenticate (getenv ('GH_PAT ' ), null , \Github \Client::AUTH_ACCESS_TOKEN );
704704 }
705- $ codeceptionReleases = $ client ->repo ()->releases ()->all ('codeception ' , 'Codeception ' );
706- $ moduleReleases = [];
705+ $ allReleases = [];
707706
708707 $ repositories = $ client ->repos ()->org ('Codeception ' , ['per_page ' => 100 ]);
709708 foreach ($ repositories as $ repository ) {
710- if ($ repository ['name ' ] !== 'Codeception ' && !str_starts_with ($ repository ['name ' ], 'module- ' )) continue ;
711- $ this ->say ($ repository ['name ' ]);
712- if ($ repository ['disabled ' ] || $ repository ['archived ' ]) continue ;
709+ $ repositoryName = $ repository ['name ' ];
710+ if ($ repositoryName !== 'Codeception ' && !str_starts_with ($ repositoryName , 'module- ' ) && !str_starts_with ($ repositoryName , 'lib- ' )) {
711+ continue ;
712+ }
713+ $ this ->say ($ repositoryName );
714+
715+ if ($ repository ['disabled ' ] || $ repository ['archived ' ]) {
716+ continue ;
717+ }
713718 try {
714- $ releases = $ client ->repo ()->releases ()->all ('codeception ' , $ repository [ ' name ' ] );
719+ $ releases = $ client ->repo ()->releases ()->all ('codeception ' , $ repositoryName );
715720 foreach ($ releases as $ k => $ release ) {
716- $ releases [$ k ]['repo ' ] = $ repository [ ' name ' ] ;
721+ $ releases [$ k ]['repo ' ] = $ repositoryName ;
717722 }
718- $ moduleReleases = array_merge ($ moduleReleases , $ releases );
723+ $ allReleases = array_merge ($ allReleases , $ releases );
719724 } catch (\Exception $ err ) {
720725// $this->say("Repository not available " . $repository['name']);
721726// $this->say($err->getMessage());
722727 }
723728 }
724729
725- $ releases = array_merge ($ codeceptionReleases , $ moduleReleases );
726- usort ($ releases , function ($ r1 , $ r2 ) {
727- return strtotime ($ r1 ['published_at ' ]) > strtotime ($ r2 ['published_at ' ]) ? -1 : 1 ;
730+ usort ($ allReleases , function ($ r1 , $ r2 ) {
731+ return -(strtotime ($ r1 ['published_at ' ]) <=> strtotime ($ r2 ['published_at ' ]));
728732 });
729733
730734 $ changelog = "" ;
731735
732- foreach ($ releases as $ release ) {
736+ foreach ($ allReleases as $ release ) {
733737 $ repo = $ release ['repo ' ] ?? 'Codeception ' ;
734- $ isModule = isset ($ release ['repo ' ]);
735738 $ changelog .= sprintf ("\n\n### %s %s: %s \n\n" , $ repo , $ release ['tag_name ' ], $ release ['name ' ]);
736739
737740 $ changelog .= sprintf ("Released by [ %s](%s) on %s " ,
@@ -754,12 +757,7 @@ public function processChangelog()
754757 "[#$1](https://github.com/Codeception/ $ repo/issues/$1) " ,
755758 $ body
756759 );
757-
758-
759-
760-
761760 $ changelog .= "\n\n$ body \n" ;
762-
763761 }
764762
765763 return $ changelog ;
0 commit comments