Skip to content

Commit

Permalink
chore: use log helper for info
Browse files Browse the repository at this point in the history
  • Loading branch information
salmanm committed Nov 18, 2020
1 parent 11031ba commit 79ed722
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const core = require('@actions/core')
const github = require('@actions/github')

const { logInfo } = require('./log')
const { getInputs } = require('./util')

const { GITHUB_TOKEN, MERGE_METHOD, EXCLUDE_PKGS } = getInputs()
Expand All @@ -17,14 +18,14 @@ async function run () {
const isDependabotPR = pr.user.login === 'dependabot[bot]'

if (!isDependabotPR) {
return core.info('Not dependabot PR, skip merging.')
return logInfo('Not dependabot PR, skip merging.')
}

// dependabot branch names are in format "dependabot/npm_and_yarn/pkg-0.0.1"
const pkgName = pr.head.ref.split('/').pop().split('-').shift()

if (EXCLUDE_PKGS.includes(pkgName)) {
return core.info(`${pkgName} is excluded, skip merging.`)
return logInfo(`${pkgName} is excluded, skip merging.`)
}

await octokit.pulls.createReview({
Expand Down

0 comments on commit 79ed722

Please sign in to comment.