diff --git a/.eslintrc.json b/.eslintrc.json index 9a17ae4..d9e6a05 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -8,7 +8,6 @@ "project": "./tsconfig.json" }, "rules": { - "no-console": "off", "i18n-text/no-en": "off", "eslint-comments/no-use": "off", "import/no-namespace": "off", diff --git a/src/main.ts b/src/main.ts index 27d7680..6d4240f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -61,14 +61,14 @@ async function run(): Promise { try { shell.config.fatal = true - console.log('Configuring Git') + core.info('Configuring Git') shell.exec(`git config --global user.name "${config.owner}"`) shell.exec(`git config --global user.email "robot@example.com"`) shell.mkdir('-p', config.clonePath) shell.cd(config.clonePath) - console.log('Cloning Repository') + core.info('Cloning Repository') shell.exec(`git clone ${config.repoUrl}`) shell.cd(config.repoDirectory) if (config.git_name) { @@ -78,18 +78,18 @@ async function run(): Promise { shell.exec(`git config user.email "${config.git_email}"`) } - console.log('Creating Branch') + core.info('Creating Branch') shell.exec(`git checkout -B ${config.branch}`) - console.log('Bump Version') + core.info('Bump Version') await bumpVersions(config) - console.log('Committing Changes') + core.info('Committing Changes') shell.exec(`git add .`) shell.exec(`git commit -m "${config.commitMsg}"`) shell.exec(`git push -u origin ${config.branch}`) - console.log('Creating Pull Request') + core.info('Creating Pull Request') const resp = await github.getOctokit(config.PAT).rest.pulls.create({ owner: config.owner, repo: config.repo, @@ -98,11 +98,11 @@ async function run(): Promise { base: config.base }) - console.log('Pull Request Created') - console.log(resp.data) + core.info('Pull Request Created') + core.debug(JSON.stringify(resp.data)) if (String(config.auto_merge) === 'true') { - console.log('Auto Merge is configured') + core.info('Auto Merge is configured') const mergeResponse = await github .getOctokit(config.PAT) .rest.pulls.merge({ @@ -111,13 +111,13 @@ async function run(): Promise { pull_number: resp.data.number, merge_method: 'squash' }) - console.log('Merge Response') - console.log(mergeResponse.data) + core.debug('Merge Response') + core.debug(JSON.stringify(mergeResponse.data)) } } catch (e) { if (e instanceof Error) core.setFailed(e.message) } - console.log('Cleanup') + core.info('Cleanup') shell.rm('-rf', config.clonePath) }