Skip to content

Commit 3ab0836

Browse files
committed
Add support for "Documentation" label
1 parent fb1b483 commit 3ab0836

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

src/Api/Issue/IssueType.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ class IssueType
1010
public const FEATURE = 'Feature';
1111
public const UNKNOWN = 'Unknown';
1212
public const RFC = 'RFC';
13+
public const DOCUMENTATION = 'Documentation';
1314
}

src/Command/PingStaleIssuesCommand.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ private function extractType(array $issue): string
9595
IssueType::FEATURE => false,
9696
IssueType::BUG => false,
9797
IssueType::RFC => false,
98+
IssueType::DOCUMENTATION => false,
9899
];
99100

100101
foreach ($issue['labels'] as $label) {

src/Subscriber/AutoLabelFromContentSubscriber.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function onPullRequest(GitHubEvent $event): void
4040
$prLabels[] = $label;
4141
}
4242

43-
// the PR body usually indicates if this is a Bug, Feature, BC Break or Deprecation
43+
// the PR body usually indicates if this is a Bug, Feature, BC Break, Deprecation or Documentation
4444
if (preg_match('/\|\s*Bug fix\?\s*\|\s*yes\s*/i', $prBody, $matches)) {
4545
$prLabels[] = 'Bug';
4646
}
@@ -53,6 +53,9 @@ public function onPullRequest(GitHubEvent $event): void
5353
if (preg_match('/\|\s*Deprecations\?\s*\|\s*yes\s*/i', $prBody, $matches)) {
5454
$prLabels[] = 'Deprecation';
5555
}
56+
if (preg_match('/\|\s*Documentation\?\s*\|\s*yes\s*/i', $prBody, $matches)) {
57+
$prLabels[] = 'Documentation';
58+
}
5659

5760
$this->labelsApi->addIssueLabels($prNumber, $prLabels, $repository);
5861

0 commit comments

Comments
 (0)