File tree Expand file tree Collapse file tree 3 files changed +23
-2
lines changed Expand file tree Collapse file tree 3 files changed +23
-2
lines changed Original file line number Diff line number Diff line change 2323 return ;
2424 }
2525
26+ if (100 === $ exception ->getCode ()) {
27+ // This is the GitHub API playing tricks on us... I could not find a way to reliably fix it so it is just better
28+ // to avoid bailing out because of it for now.
29+ return ;
30+ }
31+
2632 throw $ exception ;
2733}
2834
Original file line number Diff line number Diff line change 1414
1515require_once __DIR__ .'/root-version.php ' ;
1616
17- $ composerRootVersion = get_composer_root_version (get_last_tag_name ());
17+ try {
18+ $ composerRootVersion = get_composer_root_version (get_last_tag_name ());
19+ } catch (RuntimeException $ exception ) {
20+ if (false !== getenv ('TRAVIS ' ) && false === getenv ('GITHUB_TOKEN ' )) {
21+ // Ignore this PR to avoid too many builds to fail untimely or locally due to API rate limits because the last
22+ // release version could not be retrieved.
23+ return ;
24+ }
25+
26+ if (100 === $ exception ->getCode ()) {
27+ return ;
28+ }
29+
30+ throw $ exception ;
31+ }
1832
1933file_put_contents (
2034 __DIR__ .'/../.composer-root-version ' ,
Original file line number Diff line number Diff line change @@ -48,7 +48,8 @@ function get_last_tag_name(): string
4848 sprintf (
4949 'No tag name could be found in: %s ' ,
5050 $ lastReleaseEndpointContents
51- )
51+ ),
52+ 100
5253 );
5354 }
5455
You can’t perform that action at this time.
0 commit comments