Skip to content

Commit 6d23605

Browse files
authored
main: set filename of attachments
1 parent f5b1987 commit 6d23605

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

main.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const core = require("@actions/core")
33
const glob = require("@actions/glob")
44
const fs = require("fs")
55
const showdown = require("showdown")
6+
const path = require("path")
67

78
function getBody(bodyOrFile, convertMarkdown) {
89
let body = bodyOrFile
@@ -33,7 +34,7 @@ function getFrom(from, username) {
3334
async function getAttachments(attachments) {
3435
const globber = await glob.create(attachments.split(',').join('\n'))
3536
const files = await globber.glob()
36-
return files.map(f => ({ path: f, cid: f.replace(/^.*[\\\/]/, '')}))
37+
return files.map(f => ({ filename: path.basename(f), path: f, cid: f.replace(/^.*[\\\/]/, '')}))
3738
}
3839

3940
async function main() {

0 commit comments

Comments
 (0)