mirror of
https://github.com/peter-evans/create-or-update-comment.git
synced 2025-01-19 03:26:42 +08:00
Update octokit rest methods
This commit is contained in:
parent
152106b573
commit
6cfa7f64ae
8
index.js
8
index.js
@ -38,7 +38,7 @@ async function addReactions(octokit, repo, comment_id, reactions) {
|
|||||||
|
|
||||||
let results = await Promise.allSettled(
|
let results = await Promise.allSettled(
|
||||||
ReactionsSet.map(async (item) => {
|
ReactionsSet.map(async (item) => {
|
||||||
await octokit.reactions.createForIssueComment({
|
await octokit.rest.reactions.createForIssueComment({
|
||||||
owner: repo[0],
|
owner: repo[0],
|
||||||
repo: repo[1],
|
repo: repo[1],
|
||||||
comment_id: comment_id,
|
comment_id: comment_id,
|
||||||
@ -104,7 +104,7 @@ async function run() {
|
|||||||
var commentBody = "";
|
var commentBody = "";
|
||||||
if (editMode == "append") {
|
if (editMode == "append") {
|
||||||
// Get the comment body
|
// Get the comment body
|
||||||
const { data: comment } = await octokit.issues.getComment({
|
const { data: comment } = await octokit.rest.issues.getComment({
|
||||||
owner: repo[0],
|
owner: repo[0],
|
||||||
repo: repo[1],
|
repo: repo[1],
|
||||||
comment_id: inputs.commentId,
|
comment_id: inputs.commentId,
|
||||||
@ -114,7 +114,7 @@ async function run() {
|
|||||||
|
|
||||||
commentBody = commentBody + inputs.body;
|
commentBody = commentBody + inputs.body;
|
||||||
core.debug(`Comment body: ${commentBody}`);
|
core.debug(`Comment body: ${commentBody}`);
|
||||||
await octokit.issues.updateComment({
|
await octokit.rest.issues.updateComment({
|
||||||
owner: repo[0],
|
owner: repo[0],
|
||||||
repo: repo[1],
|
repo: repo[1],
|
||||||
comment_id: inputs.commentId,
|
comment_id: inputs.commentId,
|
||||||
@ -134,7 +134,7 @@ async function run() {
|
|||||||
core.setFailed("Missing comment 'body'.");
|
core.setFailed("Missing comment 'body'.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const { data: comment } = await octokit.issues.createComment({
|
const { data: comment } = await octokit.rest.issues.createComment({
|
||||||
owner: repo[0],
|
owner: repo[0],
|
||||||
repo: repo[1],
|
repo: repo[1],
|
||||||
issue_number: inputs.issueNumber,
|
issue_number: inputs.issueNumber,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user