Check pull request with cppcheck and post result to review comments.
inputs:
github_token:
description: "action github token"
required: false
repository:
description: "owner and repository name"
required: true
pull_request_id:
description: "pull request id"
required: true
allow_approve:
description: "allow submit approve review"
required: true
default: true
enable_checks:
description: "checks to enable"
required: true
default: "all"
install_cppcheck:
description: "install cppcheck by apt"
required: false
default: true
comment_result:
description: "submit the result in a comment"
required: false
default: true
use pull_request_target event
pull_request_target vs pull_request
name: cppcheck
on:
pull_request_target:
types: [opened, synchronize]
jobs:
cppchceck:
name: cppcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
persist-credentials: false
- uses: linuxdeepin/action-cppcheck@main
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ github.repository }}
pull_request_id: ${{ github.event.pull_request.number }}