Referencing new official PMD github action

This commit is contained in:
Abir Majumdar
2021-12-01 15:50:22 -05:00
parent c3c12f1950
commit ce771c75d8
+17 -35
View File
@@ -14,45 +14,27 @@ on:
- cron: $cron-weekly - cron: $cron-weekly
jobs: jobs:
mobile-security: pmd-code-scan:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Set up JDK 11
- name: Setup python uses: actions/setup-java@v2
uses: actions/setup-python@v2
with: with:
python-version: 3.8 java-version: '11'
distribution: 'adopt'
- name: Run Full PMD Analysis on Apex Code cache: maven
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' - name: Run PMD
id: pmd-full-analysis id: pmd
uses: abirismyname/pmd@master uses: pmd/pmd-github-action@v1
with: with:
analyse-all-code: 'true' rulesets: 'rulesets/java/quickstart.xml'
pmd-version: 'latest' sourcePath: 'src/main/java'
file-path: './src' - name: Upload SARIF file
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 uses: github/codeql-action/upload-sarif@v1
with: with:
sarif_file: pmd-output.sarif sarif_file: pmd-report.sarif
- name: Upload SARIF file
- name: No PMD Errors? uses: github/codeql-action/upload-sarif@v1
run: | with:
if ${{ steps.pmd-full-analysis.outputs.error-found }} ${{ steps.pmd-partial-analysis.outputs.error-found }} sarif_file: pmd-report.sarif
then
exit 3
fi