diff --git a/README.md b/README.md index 842ab3d..4ac68a5 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,12 @@ Changes in Gmail settings may be necessary to get this action to work. Users who have had problems have reported success by doing each of these three steps or by doing the first two steps and using a Gmail account that didn't have 2FA enabled. +##### Instead of using your normal Google password, use an App password. + +1. [Enable 2-Step Verification.](https://support.google.com/accounts/answer/185839?hl=en&co=GENIE.Platform%3DAndroid). +This is needed to create an App password. +2. [Create an App password](https://support.google.com/accounts/answer/185833?hl=en) for `Mail`. + ### Unauthenticated login (username/password fields) The parameters `username` and `password` are set as optional to support self-hosted runners access to on-premise infrastructure. If diff --git a/main.js b/main.js index 14c932c..3d2e1ac 100644 --- a/main.js +++ b/main.js @@ -3,6 +3,7 @@ const core = require("@actions/core") const glob = require("@actions/glob") const fs = require("fs") const showdown = require("showdown") +const path = require("path") function getBody(bodyOrFile, convertMarkdown) { let body = bodyOrFile @@ -33,7 +34,7 @@ function getFrom(from, username) { async function getAttachments(attachments) { const globber = await glob.create(attachments.split(',').join('\n')) const files = await globber.glob() - return files.map(f => ({ path: f, cid: f.replace(/^.*[\\\/]/, '')})) + return files.map(f => ({ filename: path.basename(f), path: f, cid: f.replace(/^.*[\\\/]/, '')})) } async function main() {