Skip to content

Commit a403c56

Browse files
committed
filter out emptry string
1 parent ca52e57 commit a403c56

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/generate-changelog.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,10 @@ export async function generateChangelog(
7272
{silent: true}
7373
)
7474

75-
const commits = command.stdout.trim().split('\n')
75+
const commits = command.stdout
76+
.trim()
77+
.split('\n')
78+
.filter(s => s)
7679
core.info(`Found commits ${commits}`)
7780

7881
// There were no differences in commits between the current version and the previous version.
@@ -117,8 +120,7 @@ async function fetchPullRequestBodyFromCommits(
117120
): Promise<string[]> {
118121
let commitsSubQuery = ''
119122
for (const oid of commits) {
120-
if (oid) {
121-
commitsSubQuery += `
123+
commitsSubQuery += `
122124
commit_${oid}: object(oid: "${oid}") {
123125
... on Commit {
124126
oid
@@ -133,7 +135,6 @@ async function fetchPullRequestBodyFromCommits(
133135
}
134136
}
135137
`
136-
}
137138
}
138139

139140
const response = await graphqlWithAuth(`

0 commit comments

Comments
 (0)