Update code to work with @octokit/rest v21.1.1
This commit is contained in:
@@ -27,6 +27,8 @@ export type GetIssuesFunc = (options: {
|
||||
owner: string
|
||||
repo: string
|
||||
state: 'open' | 'closed' | 'all' | undefined
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
[key: string]: any // Allow additional properties
|
||||
}) => Promise<{data: {title: string; number: number}[]}>
|
||||
|
||||
export async function getExistingIssueNumber(
|
||||
|
||||
15
src/main.ts
15
src/main.ts
@@ -91,21 +91,20 @@ export async function run(): Promise<void> {
|
||||
const existingIssueNumber =
|
||||
core.getInput('dedupe_issues') === 'true'
|
||||
? await issue.getExistingIssueNumber(
|
||||
octokit.rest.issues.listForRepo,
|
||||
octokit.issues.listForRepo,
|
||||
github.context.repo
|
||||
)
|
||||
: null
|
||||
|
||||
if (existingIssueNumber !== null) {
|
||||
const {data: createdComment} =
|
||||
await octokit.rest.issues.createComment({
|
||||
...github.context.repo,
|
||||
issue_number: existingIssueNumber,
|
||||
body: option.body
|
||||
})
|
||||
const {data: createdComment} = await octokit.issues.createComment({
|
||||
...github.context.repo,
|
||||
issue_number: existingIssueNumber,
|
||||
body: option.body
|
||||
})
|
||||
core.debug(`comment ${createdComment.url}`)
|
||||
} else {
|
||||
const {data: createdIssue} = await octokit.rest.issues.create({
|
||||
const {data: createdIssue} = await octokit.issues.create({
|
||||
...github.context.repo,
|
||||
...option
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user