Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add more logs #31

Merged
merged 1 commit into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

11 changes: 8 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ async function run(): Promise<void> {

await runCli();
} catch (error) {
core.error('Error occurred while running BundleMon CLI');

if (error instanceof Error) {
if (shouldFail) {
core.setFailed(error.message);
Expand All @@ -21,7 +23,7 @@ async function run(): Promise<void> {
}

function setEnvVars() {
core.info('set environment vars for BundleMon cli');
core.info('set environment vars for BundleMon CLI');

const { payload } = context;
const pr = payload.pull_request;
Expand All @@ -30,12 +32,12 @@ function setEnvVars() {
const commitMsg = context.payload.head_commit?.message || '';

if (commitSha) {
core.info('set env variable : CI_COMMIT_SHA');
core.info('set env variable: CI_COMMIT_SHA');
core.exportVariable('CI_COMMIT_SHA', commitSha);
}

if (commitMsg) {
core.info('set env variable : CI_COMMIT_MESSAGE');
core.info('set env variable: CI_COMMIT_MESSAGE');
core.exportVariable('CI_COMMIT_MESSAGE', commitMsg);
}
}
Expand Down Expand Up @@ -78,10 +80,13 @@ async function runCli() {

if (workingDirectory) {
options.cwd = workingDirectory;
core.info(`Working directory: ${workingDirectory}`);
}

const args = [getBundlemonBin(), ...bundlemonArgs];

core.info(`Running: npx ${args.join(' ')}`);

await exec.exec('npx', args, options);
}

Expand Down
Loading