Skip to content

Commit 77db61a

Browse files
committed
bug #116 Fix: Colors are case sensitive... (Nyholm)
This PR was merged into the master branch. Discussion ---------- Fix: Colors are case sensitive... Im slowly going to fix all the bugs, here is a start. FYI @javiereguiluz, I have the feeling that you add the new component labels. I made it a rule that labels for components must always be grey. Commits ------- 639567c Fix: Colors are case sensitive...
2 parents 77c4f13 + 639567c commit 77db61a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Api/Label/GithubLabelApi.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,14 @@ public function getAllLabelsForRepository(Repository $repository): array
127127
*/
128128
public function getComponentLabelsForRepository(Repository $repository): array
129129
{
130-
$key = 'component_labels'.sha1($repository->getFullName());
130+
$key = 'component_labels_'.sha1($repository->getFullName());
131131

132132
return $this->cache->get($key, function (ItemInterface $item) use ($repository) {
133133
$labels = $this->labelsApi->all($repository->getVendor(), $repository->getName()) ?? [];
134134
$item->expiresAfter(36000);
135135
$componentLabels = [];
136136
foreach ($labels as $label) {
137-
if ('dddddd' === $label['color']) {
137+
if ('dddddd' === strtolower($label['color'])) {
138138
$componentLabels[] = $label['name'];
139139
}
140140
}

src/Subscriber/AutoUpdateTitleWithLabelSubscriber.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function onPullRequest(GitHubEvent $event)
4242
$originalTitle = $prTitle = trim($data['pull_request']['title']);
4343
$validLabels = [];
4444
foreach ($data['pull_request']['labels'] as $label) {
45-
if ('dddddd' === $label['color']) {
45+
if ('dddddd' === strtolower($label['color'])) {
4646
$validLabels[] = $label['name'];
4747
// Remove label name from title
4848
$prTitle = str_replace('['.$label['name'].']', '', $prTitle);

0 commit comments

Comments
 (0)