From 13a721e1bac6b4ae77eb497536fad219aa798caf Mon Sep 17 00:00:00 2001 From: Jason Etcovitch Date: Tue, 13 Dec 2022 18:10:57 -0500 Subject: [PATCH] Fix borked types --- src/action.ts | 4 ++-- src/helpers.ts | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/action.ts b/src/action.ts index 65427bb..3e7fae5 100644 --- a/src/action.ts +++ b/src/action.ts @@ -83,7 +83,7 @@ export async function createAnIssue (tools: Toolkit) { issue_number: existingIssue.number, body: templated.body }) - setOutputs(tools, issue) + setOutputs(tools, issue.data) tools.exit.success(`Updated issue ${existingIssue.title}#${existingIssue.number}: ${existingIssue.html_url}`) } catch (err: any) { return logError(tools, template, 'updating', err) @@ -105,7 +105,7 @@ export async function createAnIssue (tools: Toolkit) { milestone: Number(tools.inputs.milestone || attributes.milestone) || undefined }) - setOutputs(tools, issue) + setOutputs(tools, issue.data) tools.log.success(`Created issue ${issue.data.title}#${issue.data.number}: ${issue.data.html_url}`) } catch (err: any) { return logError(tools, template, 'creating', err) diff --git a/src/helpers.ts b/src/helpers.ts index 2609e56..31134b4 100644 --- a/src/helpers.ts +++ b/src/helpers.ts @@ -1,5 +1,4 @@ import { Toolkit } from 'actions-toolkit' -import { IssuesCreateResponseData } from '@octokit/types' export interface FrontMatterAttributes { title: string @@ -8,9 +7,9 @@ export interface FrontMatterAttributes { milestone?: string | number } -export function setOutputs (tools: Toolkit, issue: { data: IssuesCreateResponseData }) { - tools.outputs.number = String(issue.data.number) - tools.outputs.url = issue.data.html_url +export function setOutputs (tools: Toolkit, issue: { number: number, html_url: string }) { + tools.outputs.number = String(issue.number) + tools.outputs.url = issue.html_url } export function listToArray (list?: string[] | string) {