diff --git a/index.js b/index.js index ba636ec..b8e6b00 100644 --- a/index.js +++ b/index.js @@ -4,6 +4,7 @@ import github from '@actions/github' import os from 'os' import fs from 'fs' import mime from 'mime' +import path from 'path' try { const file = core.getInput('file') @@ -16,10 +17,12 @@ try { } const machine_name = core.getInput('custom-machine-name') || os.hostname() + const custom_name = core.getInput('custom-name') || path.basename(file) const mime_type = core.getInput('content-type') || mime.getType(file) || 'data/raw' const use_salt = core.getInput('use-salt') === 'true' console.log("Uploading file: ", file) + console.log("Name: ", custom_name) console.log("Machine name: ", machine_name) console.log("Content type: ", mime_type) console.log("Use salt: ", use_salt) @@ -33,6 +36,7 @@ try { headers: { 'Content-Type': mime_type, 'x-machine-name': machine_name, + 'x-custom-name': custom_name, 'x-salt-name': use_salt ? 'true' : 'false', 'authorization': `Bearer ${token}` }