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 23
23
return ;
24
24
}
25
25
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
+
26
32
throw $ exception ;
27
33
}
28
34
Original file line number Diff line number Diff line change 14
14
15
15
require_once __DIR__ .'/root-version.php ' ;
16
16
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
+ }
18
32
19
33
file_put_contents (
20
34
__DIR__ .'/../.composer-root-version ' ,
Original file line number Diff line number Diff line change @@ -48,7 +48,8 @@ function get_last_tag_name(): string
48
48
sprintf (
49
49
'No tag name could be found in: %s ' ,
50
50
$ lastReleaseEndpointContents
51
- )
51
+ ),
52
+ 100
52
53
);
53
54
}
54
55
You can’t perform that action at this time.
0 commit comments