diff --git a/action.cjs b/action.cjs index de036b1a..62b785ad 100644 --- a/action.cjs +++ b/action.cjs @@ -51,15 +51,18 @@ module.exports = async ({ github, context, inputs, actionPath, core }) => { const commentsBefore = await commentsNumber({ context, github }) await cleanupComments({ context, github }) - const { default: addLabel } = await import(`${actionPath}/src/steps/addLabel.js`) - // unverified-commits steps const { default: unverifiedCommits } = await import(`${actionPath}/src/steps/unverifiedCommits.js`) // add unverified-commits label step const unverifiedCommitsSteps = await unverifiedCommits({ context, github }) if (unverifiedCommitsSteps === '"UNVERIFIED-CHANGED"') { - await addLabel({ context, github, label: 'unverified-commits' }) + await github.rest.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + labels: ['unverified-commits'] + }) } // run-reviewdog-pr step @@ -93,7 +96,12 @@ module.exports = async ({ github, context, inputs, actionPath, core }) => { if (shouldTrigger) { // add label step - await addLabel({ context, github, label: 'needs-security-review' }) + await github.rest.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + labels: ['needs-security-review'] + }) // add assignees step await github.rest.issues.addAssignees({ owner: context.repo.owner, diff --git a/src/steps/addLabel.js b/src/steps/addLabel.js deleted file mode 100644 index 7521df04..00000000 --- a/src/steps/addLabel.js +++ /dev/null @@ -1,12 +0,0 @@ -export default async function addLabel ({ - github, - context, - label -}) { - return github.rest.issues.addLabels({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number, - labels: [label] - }) -}