mirror of
https://github.com/redhat-actions/buildah-build.git
synced 2025-04-18 00:21:22 +00:00
sanitify output buildah from cmd
Signed-off-by: Luca Stocchi <lstocchi@redhat.com>
This commit is contained in:
parent
20c4f351ec
commit
b5c3b226ac
5 changed files with 13 additions and 4 deletions
2
dist/index.js
vendored
2
dist/index.js
vendored
File diff suppressed because one or more lines are too long
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
|
@ -10,6 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.BuildahCli = void 0;
|
||||
const core = require("@actions/core");
|
||||
const exec = require("@actions/exec");
|
||||
class BuildahCli {
|
||||
constructor(executable) {
|
||||
|
@ -25,6 +26,9 @@ class BuildahCli {
|
|||
}
|
||||
copy(container, content, path) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
core.debug('copy');
|
||||
core.debug(container);
|
||||
core.debug(content);
|
||||
const args = ["copy", container, content];
|
||||
if (path) {
|
||||
args.push(path);
|
||||
|
@ -34,6 +38,8 @@ class BuildahCli {
|
|||
}
|
||||
config(container, settings) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
core.debug('config');
|
||||
core.debug(container);
|
||||
const args = ['config'];
|
||||
if (settings.entrypoint) {
|
||||
args.push('--entrypoint');
|
||||
|
@ -49,6 +55,9 @@ class BuildahCli {
|
|||
}
|
||||
commit(container, newImageName, flags = []) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
core.debug('commit');
|
||||
core.debug(container);
|
||||
core.debug(newImageName);
|
||||
const args = ["commit", ...flags, container, newImageName];
|
||||
return yield this.execute(args);
|
||||
});
|
||||
|
|
|
@ -38,7 +38,7 @@ function run() {
|
|||
if (creationResult.succeeded === false) {
|
||||
return Promise.reject(new Error(creationResult.reason));
|
||||
}
|
||||
const containerId = creationResult.output;
|
||||
const containerId = creationResult.output.replace('\n', '');
|
||||
const copyResult = yield cli.copy(containerId, content);
|
||||
if (copyResult.succeeded === false) {
|
||||
return Promise.reject(new Error(copyResult.reason));
|
||||
|
|
|
@ -28,7 +28,7 @@ export async function run(): Promise<void> {
|
|||
if (creationResult.succeeded === false) {
|
||||
return Promise.reject(new Error(creationResult.reason));
|
||||
}
|
||||
const containerId = creationResult.output;
|
||||
const containerId = creationResult.output.replace('\n', '');
|
||||
|
||||
const copyResult = await cli.copy(containerId, content);
|
||||
if (copyResult.succeeded === false) {
|
||||
|
|
Loading…
Reference in a new issue