mirror of
https://github.com/tsickert/discord-webhook.git
synced 2025-02-03 21:16:41 -05:00
Correctly name with filename and not path
This commit is contained in:
parent
1ffc2fcbc6
commit
5a06f51498
3 changed files with 3 additions and 1 deletions
BIN
dist/index.js
generated
vendored
BIN
dist/index.js
generated
vendored
Binary file not shown.
BIN
dist/index.js.map
generated
vendored
BIN
dist/index.js.map
generated
vendored
Binary file not shown.
|
@ -4,6 +4,7 @@ import axios from 'axios'
|
|||
import * as core from '@actions/core'
|
||||
import {TypedResponse} from '@actions/http-client/lib/interfaces'
|
||||
import {HttpClient} from '@actions/http-client'
|
||||
import path from 'node:path'
|
||||
|
||||
const client = new HttpClient()
|
||||
|
||||
|
@ -34,7 +35,8 @@ export async function executeWebhook(
|
|||
if (filename !== '' || threadName !== '' || flags !== '') {
|
||||
const formData = new FormData()
|
||||
if (filename !== '') {
|
||||
formData.append('upload-file', await blob(createReadStream(filename)), filename)
|
||||
const actualFilename = path.basename(filename);
|
||||
formData.append('upload-file', await blob(createReadStream(filename)), actualFilename)
|
||||
formData.append('payload_json', JSON.stringify(payload))
|
||||
}
|
||||
if (threadName !== '') {
|
||||
|
|
Loading…
Reference in a new issue