Adding pmd

This commit is contained in:
Abir Majumdar
2021-10-27 15:35:18 -04:00
parent 0f5b68ee4f
commit c3c12f1950
2 changed files with 77 additions and 0 deletions
+58
View File
@@ -0,0 +1,58 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: pmd
on:
push:
branches: [ $default-branch, $protected-branches ]
pull_request:
branches: [ $default-branch ]
schedule:
- cron: $cron-weekly
jobs:
mobile-security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Run Full PMD Analysis on Apex Code
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
id: pmd-full-analysis
uses: abirismyname/pmd@master
with:
analyse-all-code: 'true'
pmd-version: 'latest'
file-path: './src'
rules-path: 'rulesets/apex/quickstart.xml'
# - name: Run Full PMD Analysis on Java Code
# if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
# id: pmd-full-analysis
# uses: abirismyname/pmd@master
# with:
# analyse-all-code: 'true'
# pmd-version: 'latest'
# file-path: './src'
# rules-path: 'rulesets/java/quickstart.xml'
- name: Upload pmdscan report
uses: github/codeql-action/upload-sarif@v1
with:
sarif_file: pmd-output.sarif
- name: No PMD Errors?
run: |
if ${{ steps.pmd-full-analysis.outputs.error-found }} ${{ steps.pmd-partial-analysis.outputs.error-found }}
then
exit 3
fi
@@ -0,0 +1,19 @@
{
"name": "pmd",
"creator": "pmd",
"description": "PMD is a static source code analyzer. It finds common programming flaws like unused variables, empty catch blocks, unnecessary object creation, and so forth. It supports Java, JavaScript, Salesforce.com Apex and Visualforce, Modelica, PLSQL, Apache Velocity, XML, XSL, Scala.",
"iconName": "pmd",
"categories": [
"Code Scanning",
"Java",
"JavaScript",
"Apex",
"Modelica",
"PLSQL",
"Apache Velocity",
"XML",
"XSl",
"Scala",
"Apex"
]
}