|
8 | 8 | use Laminas\AutomaticReleases\Git\Value\SemVerVersion;
|
9 | 9 | use Laminas\AutomaticReleases\Github\Api\GraphQL\Query\GetGithubMilestone;
|
10 | 10 | use Laminas\AutomaticReleases\Github\Api\V3\CreateMilestone;
|
| 11 | +use Laminas\AutomaticReleases\Github\Api\V3\CreateMilestoneFailed; |
11 | 12 | use Laminas\AutomaticReleases\Github\Event\Factory\LoadCurrentGithubEvent;
|
12 | 13 | use Laminas\AutomaticReleases\Github\Value\RepositoryName;
|
13 | 14 | use Symfony\Component\Console\Command\Command;
|
@@ -41,19 +42,19 @@ public function execute(InputInterface $input, OutputInterface $output): int
|
41 | 42 |
|
42 | 43 | $milestone->assertAllIssuesAreClosed();
|
43 | 44 |
|
44 |
| - $this->createMilestoneIfNotExists($repositoryName, $releaseVersion->nextPatch()); |
45 |
| - $this->createMilestoneIfNotExists($repositoryName, $releaseVersion->nextMinor()); |
46 |
| - $this->createMilestoneIfNotExists($repositoryName, $releaseVersion->nextMajor()); |
| 45 | + $this->createMilestoneIfNotExists($repositoryName, $releaseVersion->nextPatch(), $output); |
| 46 | + $this->createMilestoneIfNotExists($repositoryName, $releaseVersion->nextMinor(), $output); |
| 47 | + $this->createMilestoneIfNotExists($repositoryName, $releaseVersion->nextMajor(), $output); |
47 | 48 |
|
48 | 49 | return 0;
|
49 | 50 | }
|
50 | 51 |
|
51 |
| - private function createMilestoneIfNotExists(RepositoryName $repositoryName, SemVerVersion $version): bool |
| 52 | + private function createMilestoneIfNotExists(RepositoryName $repositoryName, SemVerVersion $version, OutputInterface $output): bool |
52 | 53 | {
|
53 | 54 | try {
|
54 | 55 | ($this->createMilestone)($repositoryName, $version->nextPatch());
|
55 |
| - } catch (InvalidArgumentException $e) { |
56 |
| - // Log that the milestone exists? |
| 56 | + } catch (CreateMilestoneFailed $e) { |
| 57 | + $output->writeln($e->getMessage()); |
57 | 58 | return false;
|
58 | 59 | }
|
59 | 60 |
|
|
0 commit comments