Skip to content

Commit

Permalink
Improve debug output/await
Browse files Browse the repository at this point in the history
  • Loading branch information
mxcl committed Jan 19, 2022
1 parent 5934d18 commit 97fae97
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export async function ferret(query: string, comments: AsyncGenerator<string, voi
}

for await (const comment of comments) {
debug(`comment: ${comment}`)
const match = comment.trim().match(/^#+\s*(.*?)\s*($|\n)/)
if (match && sanitize(match[1]) == query) return comment
}
Expand Down
4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ async function* sniff() {
}

const updateComment = async (body: string) => {
debug("Updating comment")
await octokit.rest.issues.updateComment({
repo, owner, body, comment_id: ctx.comment.id,
})
Expand All @@ -44,7 +45,8 @@ if (query) {
const found = await ferret(query, sniff())
await updateComment(found ?? `ferret: error: noop: ${query}`)
if (found) {
octokit.rest.issues.addLabels({
debug("Adding label")
await octokit.rest.issues.addLabels({
repo, owner, issue_number: ctx.issue.number, labels: ['ferret']
})
}
Expand Down

0 comments on commit 97fae97

Please sign in to comment.