Skip to content

reviewdog based GitHub action to run PMD on your java code

License

Notifications You must be signed in to change notification settings

telia-actions/action-pmd

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

action-pmd

Test reviewdog depup release GitHub release (latest SemVer) action-bumpr supported

This is a GitHub action to run PMD check on your Java code and report status via reviewdog on pull request.

Example

An example of how the reported pmd violations will look like on pull request is shown below (link to PR):

PR comment with violation

Inputs

inputs:
  github_token:
    description: 'GITHUB_TOKEN'
    default: '${{ github.token }}'
  workdir:
    description: 'Working directory relative to the root directory.'
    default: '.'
  ### Flags for reviewdog ###
  level:
    description: 'Report level for reviewdog [info,warning,error]'
    default: 'error'
  reporter:
    description: 'Reporter of reviewdog command [github-pr-check,github-pr-review].'
    default: 'github-pr-check'
  filter_mode:
    description: |
      Filtering mode for the reviewdog command [added,diff_context,file,nofilter].
      Default is added.
    default: 'added'
  fail_on_error:
    description: |
      Exit code for reviewdog when errors are found [true,false]
      Default is `false`.
    default: 'false'
  tool_name:
    description: 'Tool name to use for reviewdog reporter'
    default: 'pmd'
  reviewdog_flags:
    description: 'Additional reviewdog flags'
    default: ''
  ### Flags for PMD ###
  src_path:
    description: 'Specify the directory where the sources to be analyzed are stored. Default is `src/main/java`.'
    default: 'src/main/java'
  rulesets_path:
    description: 'Specify the path of the PMD rule set. Default is `rulesets/java/quickstart.xml`.'
    default: 'rulesets/java/quickstart.xml'

Usage

name: pmd
on: [pull_request]
jobs:
  pmd_job:
    runs-on: ubuntu-latest
    name: PMD job
    steps:
    - name: Checkout
      uses: actions/checkout@v3
    - name: Run PMD
      uses: kemsakurai/action-pmd@master
      with:
        github_token: ${{ secrets.GITHUB_TOKEN }}
        reporter: 'github-pr-review'
        tool_name: 'pmd_reviewdog'

About

reviewdog based GitHub action to run PMD on your java code

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 60.6%
  • Dockerfile 39.4%