mirror of
https://github.com/mshick/add-pr-comment.git
synced 2026-01-03 07:00:20 +11:00
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:
parent
3033f06feb
commit
1fbf288a23
6 changed files with 54 additions and 16 deletions
|
|
@ -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'],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue