Add top level comments, rename cleanup to post
This commit is contained in:
parent
a557279135
commit
44a27e6a51
19 changed files with 33 additions and 12 deletions
55
lib/init-action-post.js
generated
Normal file
55
lib/init-action-post.js
generated
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
"use strict";
|
||||
/**
|
||||
* This file is the entry point for the `post:` hook of `init-action.yml`.
|
||||
* It will run after the all steps in this job, in reverse order in relation to
|
||||
* other `post:` hooks.
|
||||
*/
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const core = __importStar(require("@actions/core"));
|
||||
const actionsUtil = __importStar(require("./actions-util"));
|
||||
const config_utils_1 = require("./config-utils");
|
||||
const logging_1 = require("./logging");
|
||||
async function run(uploadDatabaseBundleDebugArtifact, uploadLogsDebugArtifact, uploadFinalLogsDebugArtifact) {
|
||||
const logger = (0, logging_1.getActionsLogger)();
|
||||
let config = undefined;
|
||||
config = await (0, config_utils_1.getConfig)(actionsUtil.getTemporaryDirectory(), logger);
|
||||
if (config === undefined) {
|
||||
throw new Error("Config file could not be found at expected location. Has the 'init' action been called?");
|
||||
}
|
||||
// Upload appropriate Actions artifacts for debugging
|
||||
if (config === null || config === void 0 ? void 0 : config.debugMode) {
|
||||
await uploadDatabaseBundleDebugArtifact(config, logger);
|
||||
await uploadLogsDebugArtifact(config);
|
||||
await uploadFinalLogsDebugArtifact(config);
|
||||
}
|
||||
}
|
||||
async function runWrapper() {
|
||||
try {
|
||||
await run(actionsUtil.uploadDatabaseBundleDebugArtifact, actionsUtil.uploadLogsDebugArtifact, actionsUtil.uploadFinalLogsDebugArtifact);
|
||||
}
|
||||
catch (error) {
|
||||
core.setFailed(`init action cleanup failed: ${error}`);
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
void runWrapper();
|
||||
//# sourceMappingURL=init-action-post.js.map
|
||||
Loading…
Add table
Add a link
Reference in a new issue