Skip to content

Commit

Permalink
make the link clickable (#3457)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Mar 5, 2023
1 parent bf6fdc7 commit 00b6703
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/Console/Command/SetupCICommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,17 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$this->symfonyStyle->writeln(
'1) Generate new Github Token here:' .
PHP_EOL .
'https://github.com/settings/tokens/new'
$this->createClickableLink('https://github.com/settings/tokens/new')
);

$this->symfonyStyle->newLine();

$repositoryUrl = sprintf('https://github.com/%s/settings/secrets/actions/new', $currentRepository);

$this->symfonyStyle->writeln(
'2) Add it to your repository secrets under "GITHUB_TOKE" name:'
. PHP_EOL .
sprintf('https://github.com/%s/settings/secrets/actions/new', $currentRepository)
$this->createClickableLink($repositoryUrl)
);

$this->symfonyStyle->newLine();
Expand Down Expand Up @@ -125,4 +127,9 @@ private function resolveCurrentRepositoryName(string $currentDirectory): ?string
$match = Strings::match($output, self::GITHUB_REPOSITORY_REGEX);
return $match['repository_name'] ?? null;
}

private function createClickableLink(string $url): string
{
return sprintf('<href=%s>%s</>', $url, $url);
}
}

0 comments on commit 00b6703

Please sign in to comment.