Printing styled table
This commit is contained in:
16
app.ts
16
app.ts
@@ -1,7 +1,7 @@
|
||||
import { spawn } from "child_process";
|
||||
import { ChildProcess, SpawnOptions } from "node:child_process";
|
||||
import {spawn} from "child_process";
|
||||
import {ChildProcess, SpawnOptions} from "node:child_process";
|
||||
import * as core from '@actions/core';
|
||||
import { LogLevel, styledTable, writeConsole } from "@skydust/toolkit";
|
||||
import {LogLevel, styledTable, writeConsole} from "@skydust/toolkit";
|
||||
|
||||
// Ignored branches
|
||||
const IGNORED_BRANCHES: string[] = core.getInput('branchesToIgnore', { required: false }).split(",");
|
||||
@@ -297,16 +297,16 @@ const main = async (): Promise<void> => {
|
||||
}
|
||||
|
||||
const failedRebase = rebasedBranches.filter(rebased => !rebased.success)
|
||||
.map(rebased => [rebased.branch, rebased.onBranch, rebased.action] as string[]);
|
||||
.map(rebased => [rebased.branch.replace("origin/",""), Action[rebased.action], rebased.onBranch.replace("origin/","")] as string[]);
|
||||
|
||||
if(failedRebase.length === 0) {
|
||||
writeConsole("All rebase where done successfully", LogLevel.INFO);
|
||||
} else {
|
||||
writeConsole("Some rebase failed", LogLevel.WARNING);
|
||||
styledTable([
|
||||
["Branch", "Action", "Onto branch"],
|
||||
writeConsole("Some rebases failed.", LogLevel.WARNING);
|
||||
writeConsole(styledTable([
|
||||
["Branch", "Tried Action", "Onto branch"],
|
||||
...failedRebase
|
||||
]);
|
||||
]), LogLevel.WARNING);
|
||||
}
|
||||
} catch (error) {
|
||||
writeConsole("Error during workflow execution", LogLevel.ERROR);
|
||||
|
||||
Reference in New Issue
Block a user