Add PHPMD GitHub workflow

Signed-off-by: Sebastian Meyer <sebastian.meyer@opencultureconsulting.com>
This commit is contained in:
Sebastian Meyer 2023-11-21 21:59:06 +01:00 committed by GitHub
parent 38d566b9dc
commit 4d77176b2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 42 additions and 0 deletions

42
.github/workflows/phpmd.yml vendored Normal file
View File

@ -0,0 +1,42 @@
name: PHPMD
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: '00 03 * * 1'
permissions:
contents: read
jobs:
PHPMD:
name: Run PHPMD Scanning
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
actions: read
steps:
- name: Checkout Source Code
uses: actions/checkout@v4
- name: Setup Environment
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
coverage: none
tools: phpmd
- name: Run PHPMD
run: phpmd . sarif codesize --reportfile phpmd-results.sarif
continue-on-error: true
- name: Upload Analysis Results
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: phpmd-results.sarif
wait-for-processing: true