Skip to content

Commit

Permalink
action.yml: use import instead of require
Browse files Browse the repository at this point in the history
  • Loading branch information
thypon committed May 7, 2024
1 parent 7e475ed commit a4d369d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ runs:
script: |
const actionPath = '${{ github.action_path }}'
const commentsNumber = require(`${actionPath}/src/commentsNumber.js`)
const cleanupComments = require(`${actionPath}/src/cleanupComments.js`)
const commentsNumber = await import(`${actionPath}/src/commentsNumber.js`)
const cleanupComments = await import(`${actionPath}/src/cleanupComments.js`)
const number = commentsNumber({context, github})
cleanupComments({context, github})
Expand All @@ -141,7 +141,7 @@ runs:
script: |
const actionPath = '${{ github.action_path }}'
const unverifiedCommits = require(`${actionPath}/src/unverifiedCommits.js`)
const unverifiedCommits = await import(`${actionPath}/src/unverifiedCommits.js`)
return unverifiedCommits({context, github})
- if: ${{ steps.reviewdog-enabled.outputs.result == 'true' }}
Expand Down Expand Up @@ -212,7 +212,7 @@ runs:
with:
script: |
const actionPath = '${{ github.action_path }}'
const commentsNumber = require(`${actionPath}/src/commentsNumber.js`)
const commentsNumber = await import(`${actionPath}/src/commentsNumber.js`)
return commentsNumber({context, github})
- id: assignees-after
if: ${{ steps.reviewdog-enabled-pr.outputs.result == 'true' }}
Expand All @@ -222,7 +222,7 @@ runs:
with:
script: |
const actionPath = '${{ github.action_path }}'
const assigneesAfter = require(`${actionPath}/src/assigneesAfter.js`)
const assigneesAfter = await import(`${actionPath}/src/assigneesAfter.js`)
return assigneesAfter({context, github})
- id: assignee-removed-label
if: ${{ steps.reviewdog-enabled-pr.outputs.result == 'true' }}
Expand All @@ -232,7 +232,7 @@ runs:
with:
script: |
const actionPath = '${{ github.action_path }}'
const assigneeRemoved = require(`${actionPath}/src/assigneeRemoved.js`)
const assigneeRemoved = await import(`${actionPath}/src/assigneeRemoved.js`)
return assigneeRemoved({context, github})
- id: description-contains-hotwords
if: ${{ steps.reviewdog-enabled-pr.outputs.result == 'true' && github.actor != 'renovate[bot]' }}
Expand All @@ -242,7 +242,7 @@ runs:
with:
script: |
const actionPath = '${{ github.action_path }}'
const hotwords = require(`${actionPath}/src/hotwords.js`)
const hotwords = await import(`${actionPath}/src/hotwords.js`)
return hotwords({context, github})
- id: should-trigger
if: ${{ steps.reviewdog-enabled-pr.outputs.result == 'true' && !(steps.assignee-removed-label.outputs.result == 'true') && ( (steps.comments-before.outputs.result != steps.comments-after.outputs.result) || steps.description-contains-hotwords.outputs.result == 'true') }}
Expand Down

0 comments on commit a4d369d

Please sign in to comment.