Skip to content

Commit

Permalink
Create an issue
Browse files Browse the repository at this point in the history
  • Loading branch information
omerida committed Feb 12, 2025
1 parent 4021e8b commit a0d68d4
Showing 1 changed file with 23 additions and 20 deletions.
43 changes: 23 additions & 20 deletions .github/workflows/mess-detector.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@ name: Mess Detector Report
run-name: Run PHP Mess Detector
on: push

concurrency:
group: wiki
cancel-in-progress: true

permissions:
contents: write
issues: write

jobs:
Generate-PHPMD-Report:
Expand All @@ -28,23 +24,30 @@ jobs:
run: composer install --prefer-dist

- name: Run PHPMD
id: phpmd-results
if: always()
run: phpmd --ignore-violations-on-exit --ignore-errors-on-exit src,cli html phpmd.xml > phpmd.html

- name: Convert HTML to Markdown
id: html2markdown
if: always()
uses: rknj/[email protected]
with:
html-file: "phpmd.html"

- name: Upload report
uses: int128/upload-artifact-wiki-action@v1
id: phpmd-artifact
run: echo "report=$(phpmd --ignore-violations-on-exit --ignore-errors-on-exit src,cli text phpmd.xml)" >> $GITHUB_OUTPUT

# - 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:
path: phpmd.html
token: ${{ github.token }}
title: PHP Mess Detector run ${{ github.event.repository.updated_at }}
body: |
${{ steps.phpmd-results.outputs.report }}
- name: Show URL of wiki upload
- name: Show content of generated markdown file
if: always()
run: |
cat ${{ steps.phpmd-artifact.outputs.url }}
cat ${{ steps.html2markdown.outputs.markdown-file }}

0 comments on commit a0d68d4

Please sign in to comment.