Skip to content

Commit 30c34bd

Browse files
authored
Update README.md
1 parent d873371 commit 30c34bd

File tree

1 file changed

+50
-5
lines changed

1 file changed

+50
-5
lines changed

README.md

Lines changed: 50 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,62 @@
1-
# action-template
1+
# action-pmd
22

3-
<!-- TODO: replace kemsakurai/action-pmd with your repo name -->
43
[![Test](https://github.com/kemsakurai/action-pmd/workflows/Test/badge.svg)](https://github.com/kemsakurai/action-pmd/actions?query=workflow%3ATest)
54
[![reviewdog](https://github.com/kemsakurai/action-pmd/workflows/reviewdog/badge.svg)](https://github.com/kemsakurai/action-pmd/actions?query=workflow%3Areviewdog)
65
[![depup](https://github.com/kemsakurai/action-pmd/workflows/depup/badge.svg)](https://github.com/kemsakurai/action-pmd/actions?query=workflow%3Adepup)
76
[![release](https://github.com/kemsakurai/action-pmd/workflows/release/badge.svg)](https://github.com/kemsakurai/action-pmd/actions?query=workflow%3Arelease)
87
[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/kemsakurai/action-pmd?logo=github&sort=semver)](https://github.com/kemsakurai/action-pmd/releases)
98
[![action-bumpr supported](https://img.shields.io/badge/bumpr-supported-ff69b4?logo=github&link=https://github.com/haya14busa/action-bumpr)](https://github.com/haya14busa/action-bumpr)
109

10+
This is a GitHub action to run [PMD](https://github.com/pmd/pmd) check on your Java code and report status via [reviewdog](https://github.com/reviewdog/reviewdog) on pull request.
11+
12+
## Example
13+
14+
An example of how the reported pmd violations will look like on pull request is shown below ([link to PR](https://github.com/kemsakurai/mixcloud-java-api/pull/5)):
15+
16+
![PR comment with violation](https://user-images.githubusercontent.com/10411936/199019548-266be1ad-4927-4d4c-94ce-c3e4feeb9f98.png)
17+
18+
## Inputs
19+
```yaml
20+
inputs:
21+
github_token:
22+
description: 'GITHUB_TOKEN'
23+
default: '${{ github.token }}'
24+
workdir:
25+
description: 'Working directory relative to the root directory.'
26+
default: '.'
27+
### Flags for reviewdog ###
28+
level:
29+
description: 'Report level for reviewdog [info,warning,error]'
30+
default: 'error'
31+
reporter:
32+
description: 'Reporter of reviewdog command [github-pr-check,github-pr-review].'
33+
default: 'github-pr-check'
34+
filter_mode:
35+
description: |
36+
Filtering mode for the reviewdog command [added,diff_context,file,nofilter].
37+
Default is added.
38+
default: 'added'
39+
fail_on_error:
40+
description: |
41+
Exit code for reviewdog when errors are found [true,false]
42+
Default is `false`.
43+
default: 'false'
44+
reviewdog_flags:
45+
description: 'Additional reviewdog flags'
46+
default: ''
47+
### Flags for PMD ###
48+
src_path:
49+
description: 'Specify the directory where the sources to be analyzed are stored. Default is `src/main/java`.'
50+
default: 'src/main/java'
51+
rulesets_path:
52+
description: 'Specify the path of the PMD rule set. Default is `rulesets/java/quickstart.xml`.'
53+
default: 'rulesets/java/quickstart.xml'
54+
```
55+
1156
## Usage
1257
1358
```yaml
14-
name: reviewdog
59+
name: pmd
1560
on: [pull_request]
1661
jobs:
1762
pmd_job:
@@ -24,6 +69,6 @@ jobs:
2469
uses: kemsakurai/action-pmd@master
2570
with:
2671
github_token: ${{ secrets.GITHUB_TOKEN }}
27-
reporter: 'github-pr-check'
28-
tool_name: 'testtool'
72+
reporter: 'github-pr-review'
73+
tool_name: 'pmd_reviewdog'
2974
```

0 commit comments

Comments
 (0)