From 618dd0ee2454839dee7c8ee154c96b973ec24ebc Mon Sep 17 00:00:00 2001 From: Maxime Beauchemin Date: Fri, 9 Feb 2024 17:00:38 -0800 Subject: [PATCH] TEST --- .github/workflows/supersetbot/src/cli.js | 1 - .github/workflows/supersetbot/src/commands.js | 7 ++----- .github/workflows/supersetbot/src/context.js | 5 +++-- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/supersetbot/src/cli.js b/.github/workflows/supersetbot/src/cli.js index 6d74a4001b539..c1bba4f8dfed3 100755 --- a/.github/workflows/supersetbot/src/cli.js +++ b/.github/workflows/supersetbot/src/cli.js @@ -15,7 +15,6 @@ program }); const wrap = (f) => { - console.log('WRAP'); const { verbose } = program.opts(); return commands.commandWrapper(f, verbose); }; diff --git a/.github/workflows/supersetbot/src/commands.js b/.github/workflows/supersetbot/src/commands.js index 4bdc52dba972d..2e5300e057fd1 100644 --- a/.github/workflows/supersetbot/src/commands.js +++ b/.github/workflows/supersetbot/src/commands.js @@ -1,18 +1,15 @@ export function commandWrapper(commandFunc, verbose = false) { return async (...args) => { - console.log(`in commandWrapper ${verbose}`); try { const resp = await commandFunc(...args); // Use await to ensure the command function is executed properly if (verbose) { console.log(resp); } } catch (error) { + console.error(`Error during operation: ${error}`); if (verbose) { - console.error('Error during operation:', error); - } else { - console.error('An error occurred. Use --verbose for more details.'); + console.error(error); } - // Exit with a non-zero status code to indicate failure process.exit(1); } }; diff --git a/.github/workflows/supersetbot/src/context.js b/.github/workflows/supersetbot/src/context.js index bedcc39604e47..be542887897f9 100644 --- a/.github/workflows/supersetbot/src/context.js +++ b/.github/workflows/supersetbot/src/context.js @@ -25,13 +25,14 @@ export function getEnvContext() { throw new Error('GITHUB_TOKEN is not set. Please set the GITHUB_TOKEN environment variable.'); } const github = new Octokit({ auth: `token ${process.env.GITHUB_TOKEN}` }); + const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/'); return { source: 'CLI', github, context: { repo: { - repo: 'superset', - owner: 'apache', + repo, + owner, }, }, };