Remove ts-ignore

pull/226/head
Webber 2021-03-13 23:45:07 +01:00
parent 2c892a612e
commit 110b8ed402
4 changed files with 46 additions and 46 deletions

41
dist/index.js vendored
View File

@ -37,32 +37,34 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
}; };
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
const core = __importStar(__webpack_require__(42186)); const core = __importStar(__webpack_require__(42186));
// @ts-ignore
const model_1 = __webpack_require__(41359); const model_1 = __webpack_require__(41359);
function run() { function run() {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
model_1.Action.checkCompatibility(); try {
model_1.Cache.verify(); model_1.Action.checkCompatibility();
const { dockerfile, workspace, actionFolder } = model_1.Action; model_1.Cache.verify();
const buildParameters = yield model_1.BuildParameters.create(); const { dockerfile, workspace, actionFolder } = model_1.Action;
const baseImage = new model_1.ImageTag(buildParameters); const buildParameters = yield model_1.BuildParameters.create();
if (buildParameters.kubeConfig) { const baseImage = new model_1.ImageTag(buildParameters);
core.info('Building with Kubernetes'); if (buildParameters.kubeConfig) {
yield model_1.Kubernetes.runBuildJob(buildParameters, baseImage); core.info('Building with Kubernetes');
yield model_1.Kubernetes.runBuildJob(buildParameters, baseImage);
}
else {
// Build docker image
// TODO: No image required (instead use a version published to dockerhub for the action, supply credentials for github cloning)
const builtImage = yield model_1.Docker.build({ path: actionFolder, dockerfile, baseImage });
yield model_1.Docker.run(builtImage, Object.assign({ workspace }, buildParameters));
}
// Set output
yield model_1.Output.setBuildVersion(buildParameters.buildVersion);
} }
else { catch (error) {
// Build docker image core.setFailed(error.message);
// TODO: No image required (instead use a version published to dockerhub for the action, supply credentials for github cloning)
const builtImage = yield model_1.Docker.build({ path: actionFolder, dockerfile, baseImage });
yield model_1.Docker.run(builtImage, Object.assign({ workspace }, buildParameters));
} }
// Set output
yield model_1.Output.setBuildVersion(buildParameters.buildVersion);
}); });
} }
run().catch((error) => { run();
core.setFailed(error.message);
});
/***/ }), /***/ }),
@ -1507,7 +1509,6 @@ class Versioning {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
const description = yield this.getVersionDescription(); const description = yield this.getVersionDescription();
try { try {
// @ts-ignore
const [match, tag, commits, hash] = this.descriptionRegex1.exec(description); const [match, tag, commits, hash] = this.descriptionRegex1.exec(description);
return { return {
match, match,

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -1,30 +1,30 @@
import * as core from '@actions/core'; import * as core from '@actions/core';
// @ts-ignore
import { Action, BuildParameters, Cache, Docker, ImageTag, Kubernetes, Output } from './model'; import { Action, BuildParameters, Cache, Docker, ImageTag, Kubernetes, Output } from './model';
async function run() { async function run() {
Action.checkCompatibility(); try {
Cache.verify(); Action.checkCompatibility();
Cache.verify();
const { dockerfile, workspace, actionFolder } = Action; const { dockerfile, workspace, actionFolder } = Action;
const buildParameters = await BuildParameters.create(); const buildParameters = await BuildParameters.create();
const baseImage = new ImageTag(buildParameters); const baseImage = new ImageTag(buildParameters);
if (buildParameters.kubeConfig) { if (buildParameters.kubeConfig) {
core.info('Building with Kubernetes'); core.info('Building with Kubernetes');
await Kubernetes.runBuildJob(buildParameters, baseImage); await Kubernetes.runBuildJob(buildParameters, baseImage);
} else { } else {
// Build docker image // Build docker image
// TODO: No image required (instead use a version published to dockerhub for the action, supply credentials for github cloning) // TODO: No image required (instead use a version published to dockerhub for the action, supply credentials for github cloning)
const builtImage = await Docker.build({ path: actionFolder, dockerfile, baseImage }); const builtImage = await Docker.build({ path: actionFolder, dockerfile, baseImage });
await Docker.run(builtImage, { workspace, ...buildParameters }); await Docker.run(builtImage, { workspace, ...buildParameters });
}
// Set output
await Output.setBuildVersion(buildParameters.buildVersion);
} catch (error) {
core.setFailed(error.message);
} }
// Set output
await Output.setBuildVersion(buildParameters.buildVersion);
} }
run().catch((error) => { run();
core.setFailed(error.message);
});

View File

@ -171,8 +171,7 @@ export default class Versioning {
const description = await this.getVersionDescription(); const description = await this.getVersionDescription();
try { try {
// @ts-ignore const [match, tag, commits, hash] = this.descriptionRegex1.exec(description) as RegExpExecArray;
const [match, tag, commits, hash] = this.descriptionRegex1.exec(description);
return { return {
match, match,
@ -182,7 +181,7 @@ export default class Versioning {
}; };
} catch { } catch {
try { try {
const [match, tag, commits, hash] = this.descriptionRegex2.exec(description); const [match, tag, commits, hash] = this.descriptionRegex2.exec(description) as RegExpExecArray;
return { return {
match, match,
@ -192,7 +191,7 @@ export default class Versioning {
}; };
} catch { } catch {
try { try {
const [match, tag, commits, hash] = this.descriptionRegex3.exec(description); const [match, tag, commits, hash] = this.descriptionRegex3.exec(description) as RegExpExecArray;
return { return {
match, match,