Skip to content

Commit

Permalink
fix: default issue labels to [] if null
Browse files Browse the repository at this point in the history
  • Loading branch information
rarkins committed Jul 27, 2021
1 parent 8e7f15f commit 331077e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions lib/platform/github/__snapshots__/index.spec.ts.snap
Expand Up @@ -1590,12 +1590,12 @@ Array [
"url": "https://api.github.com/graphql",
},
Object {
"body": "{\\"title\\":\\"new-title\\",\\"body\\":\\"new-content\\"}",
"body": "{\\"title\\":\\"new-title\\",\\"body\\":\\"new-content\\",\\"labels\\":[]}",
"headers": Object {
"accept": "application/vnd.github.v3+json",
"accept-encoding": "gzip, deflate, br",
"authorization": "token abc123",
"content-length": "42",
"content-length": "54",
"content-type": "application/json",
"host": "api.github.com",
"user-agent": "RenovateBot/0.0.0-semantic-release (https://github.com/renovatebot/renovate)",
Expand Down Expand Up @@ -1840,12 +1840,12 @@ Array [
"url": "https://api.github.com/repos/some/repo/issues/2",
},
Object {
"body": "{\\"title\\":\\"title-2\\",\\"body\\":\\"new-content\\"}",
"body": "{\\"title\\":\\"title-2\\",\\"body\\":\\"new-content\\",\\"labels\\":[]}",
"headers": Object {
"accept": "application/vnd.github.v3+json",
"accept-encoding": "gzip, deflate, br",
"authorization": "token abc123",
"content-length": "40",
"content-length": "52",
"content-type": "application/json",
"host": "api.github.com",
"user-agent": "RenovateBot/0.0.0-semantic-release (https://github.com/renovatebot/renovate)",
Expand Down
2 changes: 1 addition & 1 deletion lib/platform/github/index.ts
Expand Up @@ -1136,7 +1136,7 @@ export async function ensureIssue({
body: {
title,
body,
labels,
labels: labels || [],
},
}
);
Expand Down
4 changes: 2 additions & 2 deletions lib/platform/gitlab/__snapshots__/index.spec.ts.snap
Expand Up @@ -684,12 +684,12 @@ Array [
"url": "https://gitlab.com/api/v4/projects/undefined/issues?per_page=100&author_id=undefined&state=opened",
},
Object {
"body": "{\\"title\\":\\"new-title\\",\\"description\\":\\"new-content\\"}",
"body": "{\\"title\\":\\"new-title\\",\\"description\\":\\"new-content\\",\\"labels\\":[]}",
"headers": Object {
"accept": "application/json",
"accept-encoding": "gzip, deflate, br",
"authorization": "Bearer abc123",
"content-length": "49",
"content-length": "61",
"content-type": "application/json",
"host": "gitlab.com",
"user-agent": "RenovateBot/0.0.0-semantic-release (https://github.com/renovatebot/renovate)",
Expand Down
2 changes: 1 addition & 1 deletion lib/platform/gitlab/index.ts
Expand Up @@ -824,7 +824,7 @@ export async function ensureIssue({
body: {
title,
description,
labels,
labels: labels || [],
},
});
logger.info('Issue created');
Expand Down

0 comments on commit 331077e

Please sign in to comment.