Skip to content

Commit 66f05fe

Browse files
committed
conditionally test add commits
1 parent 49c2c63 commit 66f05fe

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

src/generate-changelog.ts

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -117,21 +117,23 @@ async function fetchPullRequestBodyFromCommits(
117117
): Promise<string[]> {
118118
let commitsSubQuery = ''
119119
for (const oid of commits) {
120-
commitsSubQuery += `
121-
commit_${oid}: object(oid: "${oid}") {
122-
... on Commit {
123-
oid
124-
author {
125-
name
126-
}
127-
associatedPullRequests(first: 1) {
128-
nodes {
129-
body
130-
}
120+
if (oid) {
121+
commitsSubQuery += `
122+
commit_${oid}: object(oid: "${oid}") {
123+
... on Commit {
124+
oid
125+
author {
126+
name
127+
}
128+
associatedPullRequests(first: 1) {
129+
nodes {
130+
body
131131
}
132132
}
133133
}
134-
`
134+
}
135+
`
136+
}
135137
}
136138

137139
const response = await graphqlWithAuth(`

0 commit comments

Comments
 (0)