Run PHP Mess Detector #27
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Mess Detector Report | |
run-name: Run PHP Mess Detector | |
on: push | |
permissions: | |
issues: write | |
jobs: | |
Generate-PHPMD-Report: | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.4' | |
extensions: readline, curl, redis, mbstring, intl | |
ini-values: max_memory=512M | |
tools: composer, cs2pr, phpmd | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: composer install --prefer-dist | |
- name: Run PHPMD | |
id: phpmd-results | |
if: always() | |
run: | | |
report=`phpmd --ignore-violations-on-exit --ignore-errors-on-exit src,cli text phpmd.xml)` >> $GITHUB_OUTPUT | |
#run: phpmd --ignore-violations-on-exit --ignore-errors-on-exit src,cli text phpmd.xml | |
# - name: Convert HTML to Markdown | |
# id: html2markdown | |
# if: always() | |
# uses: rknj/[email protected] | |
# with: | |
# html-file: "./phpmd.html" | |
# - name: Read report contents | |
# id: phpmd-text | |
# run: echo "report=$(cat phpmd.txt)" >> $GITHUB_OUTPUT | |
- name: Create Issue | |
uses: dacbd/create-issue-action@main | |
id: new-issue | |
with: | |
token: ${{ github.token }} | |
title: PHP Mess Detector run ${{ github.event.repository.updated_at }} | |
body: | | |
${{ steps.phpmd-results.outputs.report }} | |
- name: Show content of generated markdown file | |
if: always() | |
run: | | |
cat ${{ steps.html2markdown.outputs.markdown-file }} |