Create a comment in exist PR (#17)

* Without pullRequest

* Try

* Use the last octokit

* Fix

* Update tests

* Fix

* Update package-lock.json
This commit is contained in:
Aleksey Leshko 2020-07-06 23:48:01 +08:00 committed by GitHub
parent 3033f06feb
commit 1fbf288a23
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 54 additions and 16 deletions

View file

@ -4,7 +4,7 @@ import {HttpClient} from '@actions/http-client'
import {Endpoints, RequestHeaders} from '@octokit/types'
import {Octokit} from '@octokit/rest'
type ListCommitPullsResponse = Endpoints['GET /repos/:owner/:repo/commits/:commit_sha/pulls']['response']
type ListCommitPullsResponse = Endpoints['GET /repos/:owner/:repo/commits/:commit_sha/pulls']['response']['data']
interface AddPrCommentInputs {
allowRepeats: boolean
@ -39,7 +39,7 @@ const listCommitPulls = async (params: ListCommitPullsParams): Promise<ListCommi
}
const getIssueNumberFromCommitPullsList = (commitPullsList: ListCommitPullsResponse): number | null =>
commitPullsList.data && commitPullsList.data.length ? commitPullsList.data[0].number : null
commitPullsList.length ? commitPullsList[0].number : null
const isMessagePresent = (
message: AddPrCommentInputs['message'],