File tree Expand file tree Collapse file tree 4 files changed +31
-3
lines changed
Expand file tree Collapse file tree 4 files changed +31
-3
lines changed Original file line number Diff line number Diff line change 3636
3737 - name : Deploy
3838 run : php ./tempest deploy
39+ env :
40+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
3941
4042
4143
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ php8.4 tempest cache:clear --all
1717php8.4 tempest discovery:generate
1818php8.4 tempest migrate:up --force
1919php8.4 tempest static:clean --force
20- php8.4 tempest static:generate
20+ php8.4 tempest static:generate --verbose=true
2121
2222# Supervisor
2323sudo supervisorctl restart all
Original file line number Diff line number Diff line change 66use Tempest \HttpClient \HttpClient ;
77use Throwable ;
88
9+ use function Tempest \env ;
10+
911final class GetLatestRelease
1012{
1113 public function __construct (
@@ -15,12 +17,23 @@ public function __construct(
1517
1618 public function __invoke (): ?string
1719 {
20+ // Added by Aidan Casey to combat the GitHub rate limits.
21+ // We will inject the GH_TOKEN using our workflow.
22+ $ headers = [];
23+
24+ if ($ githubToken = env ('GH_TOKEN ' )) {
25+ $ headers ['Authorization ' ] = 'Bearer ' . $ githubToken ;
26+ }
27+
1828 // Default release to the currently running version of Tempest.
1929 $ defaultRelease = sprintf ('v%s ' , Kernel::VERSION );
2030
2131 try {
2232 $ body = $ this ->httpClient
23- ->get ('https://api.github.com/repos/tempestphp/tempest-framework/releases/latest ' )
33+ ->get (
34+ uri: 'https://api.github.com/repos/tempestphp/tempest-framework/releases/latest ' ,
35+ headers: $ headers ,
36+ )
2437 ->body ;
2538
2639 return json_decode ($ body )->tag_name ?? $ defaultRelease ;
Original file line number Diff line number Diff line change 55use Tempest \HttpClient \HttpClient ;
66use Throwable ;
77
8+ use function Tempest \env ;
9+
810final class GetStargazersCount
911{
1012 public function __construct (
@@ -14,8 +16,19 @@ public function __construct(
1416
1517 public function __invoke (): ?string
1618 {
19+ // Added by Aidan Casey to combat the GitHub rate limits.
20+ // We will inject the GH_TOKEN using our workflow.
21+ $ headers = [];
22+
23+ if ($ githubToken = env ('GH_TOKEN ' )) {
24+ $ headers ['Authorization ' ] = 'Bearer ' . $ githubToken ;
25+ }
26+
1727 try {
18- $ body = $ this ->httpClient ->get ('https://api.github.com/repos/tempestphp/tempest-framework ' )->body ;
28+ $ body = $ this ->httpClient ->get (
29+ uri: 'https://api.github.com/repos/tempestphp/tempest-framework ' ,
30+ headers: $ headers ,
31+ )->body ;
1932 $ stargazers = json_decode ($ body )->stargazers_count ?? null ;
2033
2134 return $ stargazers > 999
You can’t perform that action at this time.
0 commit comments