Skip to content

Commit e1eb970

Browse files
author
Alexis Pierru
committed
Make sourcemap path optional, add error handling
1 parent fd1343c commit e1eb970

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

main.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ async function run() {
2727
// Mandatory
2828
const dt_upload_api_key = core.getInput("DT_UPLOAD_API_KEY");
2929
const input_binary_path = core.getInput("UPLOAD_BINARY_PATH");
30-
const sourcemap_file_path = core.getInput("SOURCEMAP_FILE_PATH");
3130

3231
// Optional
32+
const sourcemap_file_path = core.getInput("SOURCEMAP_FILE_PATH");
3333
const username = core.getInput("USERNAME");
3434
const password = core.getInput("PASSWORD");
3535
const comments = core.getInput("COMMENTS");
@@ -75,7 +75,12 @@ async function run() {
7575
form.append("file", fs.createReadStream(file_path));
7676

7777
if (sourcemap_file_path) {
78+
try {
7879
form.append("sourcemap", fs.createReadStream(sourcemap_file_path));
80+
} catch (err) {
81+
core.setFailed(err);
82+
return;
83+
}
7984
}
8085

8186
// only append optional fields if explicitly set

0 commit comments

Comments
 (0)