Skip to content

Commit

Permalink
fix: wrong color format
Browse files Browse the repository at this point in the history
  • Loading branch information
overbit committed Sep 22, 2023
1 parent 10b72b3 commit f1a3fbf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion __tests__/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ describe('run', () => {
owner: 'monalisa',
repo: 'helloworld',
name: 'touched-a-pdf-file',
color: '#FF0011'
color: 'FF0011'
});
});

Expand Down
3 changes: 2 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ function isListEqual(listA, listB) {
return listA.length === listB.length && listA.every(el => listB.includes(el));
}
function setLabels(client, prNumber, labels, labelsColour) {
var _a;
return __awaiter(this, void 0, void 0, function* () {
// remove previous labels
yield client.rest.issues.setLabels({
Expand All @@ -331,7 +332,7 @@ function setLabels(client, prNumber, labels, labelsColour) {
owner: github.context.repo.owner,
repo: github.context.repo.repo,
name: label,
color: color !== null && color !== void 0 ? color : '#EDEDED'
color: (_a = color.replace('#', '')) !== null && _a !== void 0 ? _a : 'EDEDED'
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/labeler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ async function setLabels(
owner: github.context.repo.owner,
repo: github.context.repo.repo,
name: label,
color: color ?? '#EDEDED'
color: color.replace('#', '') ?? 'EDEDED'
});
}
}
Expand Down

0 comments on commit f1a3fbf

Please sign in to comment.