Skip to content

Commit

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

module.exports = async ({ github, context, inputs, steps, actionPath, core }) => {
// run-reviewdog-pr step
if (steps['reviewdog-enabled-pr'].outputs.result === 'true') {
const { execSync } = require('child_process')
const env = {
...process.env,
ASSIGNEES: inputs.assignees,
REVIEWDOG_GITHUB_API_TOKEN: inputs.github_token,
SEC_ACTION_DEBUG: inputs.debug,
PYPI_INDEX_URL: inputs.pip_audit_pypi_index_url,
PYPI_INSECURE_HOSTS: inputs.pip_audit_pypi_insecure_hosts
}
execSync(`${github.action_path}/assets/reviewdog.sh`, { env })
}
// run-reviewdog-full step
if (steps['reviewdog-enabled-full'].outputs.result === 'true') {
const { execSync } = require('child_process')
const env = { ...process.env }
delete env.GITHUB_BASE_REF
execSync(`${actionPath}/assets/reviewdog.sh`, { env })
}
// comments-after step
let commentsAfter = null
if (steps['reviewdog-enabled-pr'].outputs.result === 'true') {
Expand Down
25 changes: 0 additions & 25 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -194,31 +194,6 @@ runs:
script: |
const { execSync } = require('child_process')
execSync('${{ github.action_path }}/assets/debug.sh')
# REVIEWDOG Run
- if: ${{ steps.reviewdog-enabled-pr.outputs.result == 'true' }}
name: Run reviewdog
id: run-reviewdog-pr
env:
ASSIGNEES: ${{inputs.assignees}}
REVIEWDOG_GITHUB_API_TOKEN: ${{ inputs.github_token }}
SEC_ACTION_DEBUG: ${{ inputs.debug }}
PYPI_INDEX_URL: ${{ inputs.pip_audit_pypi_index_url }}
PYPI_INSECURE_HOSTS: ${{ inputs.pip_audit_pypi_insecure_hosts }}
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
script: |
const { execSync } = require('child_process')
execSync('${{ github.action_path }}/assets/reviewdog.sh')
- if: ${{ steps.reviewdog-enabled-full.outputs.result == 'true' }}
name: Run reviewdog full
id: run-reviewdog-full
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
script: |
const { execSync } = require('child_process')
const env = { ...process.env }
delete env['GITHUB_BASE_REF']
execSync('${{ github.action_path }}/assets/reviewdog.sh', { env })
- uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
script: |
Expand Down

0 comments on commit 355e067

Please sign in to comment.