Skip to content

Commit

Permalink
action.*: move debug in cjs
Browse files Browse the repository at this point in the history
  • Loading branch information
thypon committed May 17, 2024
1 parent 355e067 commit 7b89798
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
9 changes: 9 additions & 0 deletions action.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ function hashFiles (filename) {
}

module.exports = async ({ github, context, inputs, steps, actionPath, core }) => {
// debug step
if (steps['reviewdog-enabled'].outputs.result === 'true' && inputs.debug === 'true') {
const { execSync } = require('child_process')
const env = {
...process.env,
ASSIGNEES: inputs.assignees
}
execSync(`${actionPath}/assets/debug.sh`, { env })
}
// run-reviewdog-pr step
if (steps['reviewdog-enabled-pr'].outputs.result === 'true') {
const { execSync } = require('child_process')
Expand Down
8 changes: 0 additions & 8 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -186,14 +186,6 @@ runs:
repo: aquasecurity/tfsec
tag: v1.28.1
cache: enable
- if: ${{ steps.reviewdog-enabled.outputs.result == 'true' && inputs.debug == 'true'}}
env:
ASSIGNEES: ${{inputs.assignees}}
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
script: |
const { execSync } = require('child_process')
execSync('${{ github.action_path }}/assets/debug.sh')
- uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
script: |
Expand Down

0 comments on commit 7b89798

Please sign in to comment.