Skip to content

Commit

Permalink
refactor: add debug logs
Browse files Browse the repository at this point in the history
  • Loading branch information
vojtesaak committed Feb 12, 2024
1 parent 3fc129a commit e0a63d7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ async function run() {

let error = null;
try {
console.log(process.env.NPM_TOKEN)
const config = await prepareConfig(lintConfig);
const installPresetPackage = config.extends[0];
await installPreset(installPresetPackage + '@latest');
await installPreset(installPresetPackage + '@latest ');
await validatePullRequest(installPresetPackage, contextPullRequest.title, contextPullRequest.body, contextPullRequest);
} catch (err) {
error = err;
Expand Down
16 changes: 10 additions & 6 deletions src/install-preset.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@ const exec = util.promisify(require('child_process').exec);
* @returns {Promise<void>}
*/
module.exports = async (preset) => {
const {stdout, stderr} = await exec(`npm install ${preset}`, {
cwd: path.resolve(__dirname)
});
await exec(`npm set "//registry.npmjs.org/:_authToken=${process.env.NPM_TOKEN}"`);
const {
stdout,
stderr
} = await exec(`npm install ${preset}`, {
cwd: path.resolve(__dirname)
});

core.debug(stdout);
core.debug(stderr);
return Promise.resolve();
core.debug(stdout);
core.debug(stderr);
return Promise.resolve();
};

0 comments on commit e0a63d7

Please sign in to comment.