Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7d350c9

Browse files
authored
Update Welcome a first-time contributor example
1 parent 9bd6ae6 commit 7d350c9

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -166,16 +166,18 @@ jobs:
166166
creator,
167167
state: 'all'
168168
})
169-
const issues = await github.paginate(opts)
170-
171-
for (const issue of issues) {
172-
if (issue.number === context.issue.number) {
173-
continue
169+
170+
const issues = await github.paginate(opts, (response, done) => {
171+
const pr = response.data.find((issue) => issue.number !== context.issue.number && issue.pull_request)
172+
173+
if (pr) {
174+
done() // Stop paginating
175+
return pr
174176
}
177+
})
175178
176-
if (issue.pull_request) {
177-
return // Creator is already a contributor.
178-
}
179+
if (issues.length) {
180+
return
179181
}
180182
181183
await github.rest.issues.createComment({

0 commit comments

Comments
 (0)