Skip to content

Commit

Permalink
fix: don't group the actual running of the commands
Browse files Browse the repository at this point in the history
  • Loading branch information
ffMathy authored and chrmarti committed Feb 7, 2025
1 parent 657cc0a commit 89276e1
Showing 1 changed file with 28 additions and 33 deletions.
61 changes: 28 additions & 33 deletions github-action/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,39 +171,34 @@ export async function runMain(): Promise<void> {
return;
}

const execResult = await core.group(
'🚀 Run command in container',
async () => {
const args: DevContainerCliExecArgs = {
workspaceFolder,
configFile,
command: ['bash', '-c', runCommand],
env: inputEnvsWithDefaults,
userDataFolder,
};
let execLogString = '';
const execLog = (message: string): void => {
core.info(message);
if (!message.includes('@devcontainers/cli')) {
execLogString += message;
}
};
const exitCode = await devcontainer.exec(args, execLog);
if (exitCode !== 0) {
const errorMessage = `Dev container exec failed: (exit code: ${exitCode})`;
core.error(errorMessage);
core.setFailed(errorMessage);
}
core.setOutput('runCmdOutput', execLogString);
if (Buffer.byteLength(execLogString, 'utf-8') > 1000000) {
execLogString = truncate(execLogString, 999966);
execLogString += 'TRUNCATED TO 1 MB MAX OUTPUT SIZE';
}
core.setOutput('runCmdOutput', execLogString);
return exitCode;
},
);
if (execResult !== 0) {

const args: DevContainerCliExecArgs = {
workspaceFolder,
configFile,
command: ['bash', '-c', runCommand],
env: inputEnvsWithDefaults,
userDataFolder,
};
let execLogString = '';
const execLog = (message: string): void => {
core.info(message);
if (!message.includes('@devcontainers/cli')) {
execLogString += message;
}
};
const exitCode = await devcontainer.exec(args, execLog);
if (exitCode !== 0) {
const errorMessage = `Dev container exec failed: (exit code: ${exitCode})`;
core.error(errorMessage);
core.setFailed(errorMessage);
}
core.setOutput('runCmdOutput', execLogString);
if (Buffer.byteLength(execLogString, 'utf-8') > 1000000) {
execLogString = truncate(execLogString, 999966);
execLogString += 'TRUNCATED TO 1 MB MAX OUTPUT SIZE';
}
core.setOutput('runCmdOutput', execLogString);
if (exitCode !== 0) {
return;
}
} else {
Expand Down

0 comments on commit 89276e1

Please sign in to comment.