Skip to content

Commit

Permalink
fix/ci(workflows/pmd): fail build if pmd detects violations
Browse files Browse the repository at this point in the history
The PMD check does not fail if it detects more than one violation, this PR resolves that. (#2)
* fix/ci(workflows/pmd): fail build if pmd detects violations
* fix(ci/pmd): actually fail the check

---------

Signed-off-by: Bacon <[email protected]>
  • Loading branch information
Baconing committed Sep 30, 2024
1 parent d798ccc commit dcab22e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/workflows/pmd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ jobs:
java-version: '17'

- name: Run PMD
id: pmd
uses: pmd/pmd-github-action@v2
with:
sourcePath: "src/main/java"
rulesets: "pmd.xml"
rulesets: "pmd.xml"

- name: PMD failed
if: ${{ !success() || steps.pmd.outputs.violations > 0 }}
run: exit 1

0 comments on commit dcab22e

Please sign in to comment.