Skip to content

Commit 1ef5282

Browse files
authored
Merge pull request #49 from Aeliot-Tm/todo-registrar
#40 Add config for TODO Registrar
2 parents ab604e7 + 3347ba5 commit 1ef5282

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

scripts/todo-registrar/config.php

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/*
6+
* This file is part of the PHP CS Fixer Baseline project.
7+
*
8+
* (c) Anatoliy Melnikov <[email protected]>
9+
*
10+
* This source file is subject to the MIT license that is bundled
11+
* with this source code in the file LICENSE.
12+
*/
13+
14+
use Aeliot\TodoRegistrar\Config;
15+
use Aeliot\TodoRegistrar\Enum\RegistrarType;
16+
use Aeliot\TodoRegistrar\Service\File\Finder;
17+
18+
$finder = (new Finder())
19+
->files()
20+
->ignoreVCS(true)
21+
->in(dirname(__DIR__, 2))
22+
->exclude(['tests/fixtures', 'tools', 'var', 'vendor'])
23+
->append([dirname(__DIR__, 2) . '/bin/pcsf-baseline']);
24+
25+
return (new Config())
26+
->setFinder($finder)
27+
->setRegistrar(RegistrarType::Github, [
28+
'issue' => [
29+
'addTagToLabels' => true,
30+
'labels' => ['tech-debt'],
31+
'tagPrefix' => 'tag-',
32+
],
33+
'service' => [
34+
'personalAccessToken' => $_ENV['GH_PERSONAL_ACCESS_TOKEN'] ?? $_SERVER['GH_PERSONAL_ACCESS_TOKEN'] ?? null,
35+
'owner' => $_ENV['GITHUB_REPOSITORY_OWNER'] ?? $_SERVER['GITHUB_REPOSITORY_OWNER'] ?? null,
36+
'repository' => substr($_ENV['GITHUB_REPOSITORY'] ?? $_SERVER['GITHUB_REPOSITORY'] ?? '',
37+
strlen($_ENV['GITHUB_REPOSITORY_OWNER'] ?? $_SERVER['GITHUB_REPOSITORY_OWNER'] ?? '') + 1),
38+
],
39+
]);

0 commit comments

Comments
 (0)