Skip to content

Commit 018e8b6

Browse files
Fix styling
1 parent d56a2ee commit 018e8b6

File tree

2 files changed

+20
-19
lines changed

2 files changed

+20
-19
lines changed

packages/monorepo/src/Commands/CreateRelease.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -670,30 +670,30 @@ protected function changeGithubWorkflow(array $newPackages, string $version): vo
670670
}
671671
}
672672

673-
protected function createRelease(string $version): void
673+
protected function createRelease(string $version): void
674674
{
675675
$repo = config('monorepo.public_repo', 'mooxphp/moox');
676-
676+
677677
// Detect if this is a prerelease
678678
$isPrerelease = preg_match('/-(alpha|beta|rc)\b/i', $version);
679679
$releaseType = $isPrerelease ? 'prerelease' : 'stable release';
680-
680+
681681
$this->line("Creating monorepo {$releaseType} for version: {$version}");
682-
682+
683683
// Create appropriate release body
684-
$releaseBody = $isPrerelease
684+
$releaseBody = $isPrerelease
685685
? "Prerelease version {$version} - Please test thoroughly before using in production."
686686
: "Release version {$version}";
687-
687+
688688
$result = $this->githubService->createRelease($repo, $version, $releaseBody);
689-
689+
690690
if ($result !== null) {
691691
$icon = $isPrerelease ? '🚧' : '';
692692
$this->line("{$icon} Successfully created monorepo {$releaseType}");
693693
$this->line("Release created: v{$version}");
694-
694+
695695
if ($isPrerelease) {
696-
$this->warn("⚠️ This is a prerelease - users will need to explicitly install this version");
696+
$this->warn('⚠️ This is a prerelease - users will need to explicitly install this version');
697697
}
698698
} else {
699699
$this->error('❌ Failed to create monorepo release');

packages/monorepo/src/Services/GitHubService.php

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,45 +50,46 @@ public function postJson(string $url, array $data = []): ?array
5050
$errorMessage = $response->body();
5151
$statusCode = $response->status();
5252
\Log::error("GitHub API POST ({$url}) request failed: Status {$statusCode}, Message: {$errorMessage}");
53-
53+
5454
return null;
5555
}
5656

5757
public function getOrgHostedRunners(string $org): ?array
5858
{
5959
$url = "https://api.github.com/orgs/{$org}/actions/hosted-runners";
60+
6061
return $this->fetchJson($url);
6162
}
6263

6364
public function getWorkflows(string $org, string $repo): ?array
6465
{
6566
$url = "https://api.github.com/repos/{$org}/{$repo}/actions/workflows";
67+
6668
return $this->fetchJson($url);
6769
}
6870

69-
7071
public function triggerWorkflowDispatch(string $org, string $repo, string $workflowId, string $ref = 'main', array $inputs = []): ?array
7172
{
7273
$url = "https://api.github.com/repos/{$org}/{$repo}/actions/workflows/{$workflowId}/dispatches";
73-
74+
7475
$data = [
7576
'ref' => $ref,
7677
];
77-
78-
if (!empty($inputs)) {
78+
79+
if (! empty($inputs)) {
7980
$data['inputs'] = $inputs;
8081
}
81-
82+
8283
return $this->postJson($url, $data);
8384
}
8485

85-
public function createRelease(string $repoFullName, string $version, string $body = null, string $targetCommitish = 'main'): ?array
86+
public function createRelease(string $repoFullName, string $version, ?string $body = null, string $targetCommitish = 'main'): ?array
8687
{
8788
$url = "https://api.github.com/repos/{$repoFullName}/releases";
88-
89+
8990
// Detect if this is a prerelease (alpha, beta, rc)
9091
$isPrerelease = preg_match('/-(alpha|beta|rc)\b/i', $version);
91-
92+
9293
$data = [
9394
'tag_name' => "v{$version}",
9495
'target_commitish' => $targetCommitish,
@@ -98,7 +99,7 @@ public function createRelease(string $repoFullName, string $version, string $bod
9899
'prerelease' => $isPrerelease,
99100
'generate_release_notes' => false,
100101
];
101-
102+
102103
return $this->postJson($url, $data);
103104
}
104105

0 commit comments

Comments
 (0)