diff --git a/src/repository/github.ts b/src/repository/github.ts index 10a8ab7..cd6d54e 100644 --- a/src/repository/github.ts +++ b/src/repository/github.ts @@ -2,7 +2,7 @@ import axios from "axios"; import * as core from "@actions/core"; type GithubGetPR = { - users: GithubGetReviewerNameResult[]; + requested_reviewers: GithubGetReviewerNameResult[]; title: string; html_url: string; }; @@ -23,5 +23,7 @@ export const getPR = async ( headers: { authorization: `Bearer ${repoToken}` }, }, ); + if (result.data.requested_reviewers.length == 0) return null; + return result.data; }; diff --git a/src/usecase.ts b/src/usecase.ts index cb685f8..e87a17f 100644 --- a/src/usecase.ts +++ b/src/usecase.ts @@ -43,7 +43,7 @@ export const execPrReviewRequestedMention = async ( throw new Error("Can not find review requested user."); } - const reviewers = pr.users.map((user) => user.login) + const reviewers = pr.requested_reviewers.map((user) => user.login) core.info(`reviewers ${reviewers}`); const slackIds = convertToChatworkUsername(reviewers, mapping);