mirror of
https://github.com/tsickert/discord-webhook.git
synced 2025-02-03 21:16:41 -05:00
Fix blob
This commit is contained in:
parent
0f88348386
commit
4c21ae0a2d
1 changed files with 3 additions and 6 deletions
|
@ -1,9 +1,9 @@
|
|||
import * as core from '@actions/core'
|
||||
import axios from 'axios'
|
||||
import blob from 'node:stream/consumers'
|
||||
import {createReadStream, readFileSync} from 'fs'
|
||||
import {HttpClient} from '@actions/http-client'
|
||||
import {TypedResponse} from '@actions/http-client/lib/interfaces'
|
||||
import {blob} from 'node:stream/consumers'
|
||||
import axios from 'axios'
|
||||
|
||||
const WEBHOOK_URL = 'webhook-url'
|
||||
const CONTENT = 'content'
|
||||
|
@ -148,10 +148,7 @@ export async function executeWebhook(): Promise<void> {
|
|||
if (filename !== '' || threadName !== '' || flags !== '') {
|
||||
const formData = new FormData()
|
||||
if (filename !== '') {
|
||||
formData.append(
|
||||
'upload-file',
|
||||
await blob(createReadStream(filename))
|
||||
)
|
||||
formData.append('upload-file', await blob(createReadStream(filename)))
|
||||
formData.append('payload_json', JSON.stringify(payload))
|
||||
}
|
||||
if (threadName !== '') {
|
||||
|
|
Loading…
Reference in a new issue