Skip to content

Commit

Permalink
Merge pull request #49 from Aeliot-Tm/todo-registrar
Browse files Browse the repository at this point in the history
#40 Add config for TODO Registrar
  • Loading branch information
Aeliot-Tm authored Oct 8, 2024
2 parents ab604e7 + 3347ba5 commit 1ef5282
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions scripts/todo-registrar/config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

declare(strict_types=1);

/*
* This file is part of the PHP CS Fixer Baseline project.
*
* (c) Anatoliy Melnikov <[email protected]>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/

use Aeliot\TodoRegistrar\Config;
use Aeliot\TodoRegistrar\Enum\RegistrarType;
use Aeliot\TodoRegistrar\Service\File\Finder;

$finder = (new Finder())
->files()
->ignoreVCS(true)
->in(dirname(__DIR__, 2))
->exclude(['tests/fixtures', 'tools', 'var', 'vendor'])
->append([dirname(__DIR__, 2) . '/bin/pcsf-baseline']);

return (new Config())
->setFinder($finder)
->setRegistrar(RegistrarType::Github, [
'issue' => [
'addTagToLabels' => true,
'labels' => ['tech-debt'],
'tagPrefix' => 'tag-',
],
'service' => [
'personalAccessToken' => $_ENV['GH_PERSONAL_ACCESS_TOKEN'] ?? $_SERVER['GH_PERSONAL_ACCESS_TOKEN'] ?? null,
'owner' => $_ENV['GITHUB_REPOSITORY_OWNER'] ?? $_SERVER['GITHUB_REPOSITORY_OWNER'] ?? null,
'repository' => substr($_ENV['GITHUB_REPOSITORY'] ?? $_SERVER['GITHUB_REPOSITORY'] ?? '',
strlen($_ENV['GITHUB_REPOSITORY_OWNER'] ?? $_SERVER['GITHUB_REPOSITORY_OWNER'] ?? '') + 1),
],
]);

0 comments on commit 1ef5282

Please sign in to comment.