Skip to content

Commit

Permalink
Merge pull request #224 from act10ns/fix-json-parse-error
Browse files Browse the repository at this point in the history
Fix json parse error
  • Loading branch information
satterly committed Nov 21, 2021
2 parents cb56e15 + 0e86da2 commit f912ccb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/slack.ts
Expand Up @@ -301,6 +301,8 @@ export async function send(
const title = titleTemplate(data)
const text = textTemplate(data)
const fallback = fallbackTemplate(data)
const fieldsJson = fieldsTemplate(data)
core.debug(fieldsJson.toString())
const fields = JSON.parse(fieldsTemplate(data))
const footer = footerTemplate(data)

Expand All @@ -325,6 +327,8 @@ export async function send(
footer,
footer_icon: DEFAULT_FOOTER_ICON
}
const blocksJson = blocksTemplate({...data, ...blockContext})
core.debug(blocksJson.toString())
const blocks = JSON.parse(blocksTemplate({...data, ...blockContext}))

const attachments: MessageAttachment[] = [
Expand Down

0 comments on commit f912ccb

Please sign in to comment.