Added checks to make sure the specified track exists

Added precondition checks to validate input files and paths to return more informative error messages as per #2
This commit is contained in:
Drew Heavner
2019-12-11 23:40:19 -05:00
parent 3fe51cca76
commit 3e0a7f808c
7306 changed files with 1659333 additions and 0 deletions

View File

@@ -1,4 +1,5 @@
import * as core from '@actions/core';
import * as fs from "fs";
import {uploadRelease} from "./edits";
const {google} = require('googleapis');
@@ -27,6 +28,22 @@ async function run() {
userFractionFloat = undefined
}
// Check release file
if (!fs.existsSync(releaseFile)) {
core.setFailed(`Unable to find release file @ ${releaseFile}`);
return
}
if (whatsNewDir != undefined && !fs.existsSync(whatsNewDir)) {
core.setFailed(`Unable to find 'whatsnew' directory @ ${whatsNewDir}`);
return
}
if (mappingFile != undefined && !fs.existsSync(mappingFile)) {
core.setFailed(`Unable to find 'mappingFile' @ ${mappingFile}`);
return
}
// Insure that the api can find our service account credentials
core.exportVariable("GOOGLE_APPLICATION_CREDENTIALS", serviceAccountJson);