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:
14
lib/main.js
14
lib/main.js
@@ -16,6 +16,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const core = __importStar(require("@actions/core"));
|
||||
const fs = __importStar(require("fs"));
|
||||
const edits_1 = require("./edits");
|
||||
const { google } = require('googleapis');
|
||||
const auth = new google.auth.GoogleAuth({
|
||||
@@ -42,6 +43,19 @@ function run() {
|
||||
else {
|
||||
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);
|
||||
const authClient = yield auth.getClient();
|
||||
|
||||
Reference in New Issue
Block a user