Skip to content

Commit

Permalink
Correctly name with filename and not path
Browse files Browse the repository at this point in the history
  • Loading branch information
tsickert committed Apr 5, 2024
1 parent 1ffc2fc commit 5a06f51
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
19 changes: 18 additions & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion lib/discord/webhook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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 !== '') {
Expand Down

0 comments on commit 5a06f51

Please sign in to comment.