# 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