Skip to content
This repository has been archived by the owner on Jul 1, 2024. It is now read-only.

fix: use correct octokit method for createComment #156

Merged
merged 1 commit into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 6 additions & 15 deletions .github/workflows/benchmark-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,9 @@ jobs:
issue_number: PR_ID,
}).then(cs => cs.find((c) => c.user.login === 'npm-cli-bot'))

if (updateComment) {
await github.rest.issues.updateComment({
owner: OWNER,
repo: REPO,
comment_id: updateComment.id,
body: COMMENT,
})
} else {
await github.issues.createComment({
owner: OWNER,
repo: REPO,
issue_number: PR_ID,
body: COMMENT,
})
}
await github.rest.issues[updateComment ? 'updateComment' : 'createComment']({
owner: OWNER,
repo: REPO,
body: COMMENT,
...updateComment ? { comment_id: updateComment.id } : { issue_number: PR_ID },
})
23 changes: 6 additions & 17 deletions scripts/template-oss/benchmark-cli-yml.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,9 @@ jobs:
issue_number: PR_ID,
}).then(cs => cs.find((c) => c.user.login === 'npm-cli-bot'))

if (updateComment) {
await github.rest.issues.updateComment({
owner: OWNER,
repo: REPO,
comment_id: updateComment.id,
body: COMMENT,
})
} else {
await github.issues.createComment({
owner: OWNER,
repo: REPO,
issue_number: PR_ID,
body: COMMENT,
})
}


await github.rest.issues[updateComment ? 'updateComment' : 'createComment']({
owner: OWNER,
repo: REPO,
body: COMMENT,
...updateComment ? { comment_id: updateComment.id } : { issue_number: PR_ID },
})
Loading