Skip to content

devskim scans through linter cache of other linters #1391

devskim scans through linter cache of other linters

devskim scans through linter cache of other linters #1391

name: Slash Command Dispatch
on:
issue_comment:
types: [created]
jobs:
slashCommandDispatch:
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push, comment issues & post new PR
# Remove the ones you do not need
contents: write
issues: write
pull-requests: write
steps:
- name: Dump the event payload context
env:
EVENT_CONTEXT: ${{ toJson(github.event) }}
run: echo "$EVENT_CONTEXT"
- uses: actions/github-script@v6
id: get-pr
with:
script: |
const request = {
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number
}
core.info(`Getting PR #${request.pull_number} from ${request.owner}/${request.repo}`)
try {
const result = await github.rest.pulls.get(request);
core.setOutput('head_ref', result.data.head.ref);
core.setOutput('head_repo_full_name', result.data.head.repo.full_name);
return result.data;
} catch (err) {
core.setFailed(`Request failed with error ${err}`)
}
- name: Dump the get-pr payload context
env:
GETPR_OUTPUTS: ${{ toJson(steps.get-pr.outputs) }}
run: echo "$GETPR_OUTPUTS"
- name: Slash Command Dispatch PR
uses: peter-evans/slash-command-dispatch@v3
id: scd
if: success()
with:
token: ${{ secrets.GITHUB_TOKEN }}
commands: |
build
help
issue-type: pull-request
dispatch-type: workflow
static-args: |
repository=${{ github.repository }}
comment-id=${{ github.event.comment.id }}
issue-number=${{ github.event.issue.number }}
actor=${{ github.actor }}
checkout-ref=${{ steps.get-pr.outputs.head_ref }}
checkout-repository=${{ steps.get-pr.outputs.head_repo_full_name }}
- name: Edit comment with error message
if: steps.scd.outputs.error-message
uses: peter-evans/create-or-update-comment@v3
with:
comment-id: ${{ github.event.comment.id }}
body: |
> ${{ steps.scd.outputs.error-message }}