Skip to content

Commit

Permalink
Fix borked types
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonEtco committed Dec 13, 2022
1 parent a623f48 commit 13a721e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/action.ts
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
7 changes: 3 additions & 4 deletions src/helpers.ts
@@ -1,5 +1,4 @@
import { Toolkit } from 'actions-toolkit'
import { IssuesCreateResponseData } from '@octokit/types'

export interface FrontMatterAttributes {
title: string
Expand All @@ -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) {
Expand Down

0 comments on commit 13a721e

Please sign in to comment.