Skip to content

Commit e12e0dd

Browse files
fix: submitting an empty array for labels or assignees is now accepted
1 parent 3df9fb5 commit e12e0dd

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

lib/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28001,11 +28001,15 @@ class GithubApi {
2800128001
}
2800228002
setIssueAssignees(assignees) {
2800328003
return __awaiter(this, void 0, void 0, function* () {
28004+
if (!assignees.length)
28005+
return;
2800428006
yield this.octokit.issues.addAssignees(Object.assign(Object.assign({}, this.repo), { issue_number: this.issueNumber, assignees }));
2800528007
});
2800628008
}
2800728009
setIssueLabels(labels) {
2800828010
return __awaiter(this, void 0, void 0, function* () {
28011+
if (!labels.length)
28012+
return;
2800928013
yield this.octokit.issues.addLabels(Object.assign(Object.assign({}, this.repo), { issue_number: this.issueNumber, labels }));
2801028014
});
2801128015
}

src/github.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export class GithubApi {
2626
}
2727

2828
public async setIssueAssignees(assignees: string[]) {
29+
if(!assignees.length) return;
2930
await this.octokit.issues.addAssignees({
3031
...this.repo,
3132
issue_number: this.issueNumber,
@@ -34,6 +35,7 @@ export class GithubApi {
3435
}
3536

3637
public async setIssueLabels(labels: string[]) {
38+
if(!labels.length) return;
3739
await this.octokit.issues.addLabels({
3840
...this.repo,
3941
issue_number: this.issueNumber,

0 commit comments

Comments
 (0)