Skip to content

Fix Github report format #443

Fix Github report format

Fix Github report format #443

Workflow file for this run

name: complexity
on:
pull_request:
jobs:
evaluate-complexity:
name: wily check
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install Wily
run: pip install 'wily>=1.25.0'
- name: Build cache and diff
id: wily
run: |
wily build ruff_sync.py tasks.py tests/
DIFF=$(wily diff ruff_sync.py tasks.py tests/ --no-detail -r origin/${{ github.event.pull_request.base.ref }})
echo "$DIFF"
# Build multiline output
echo "diff<<DIFF_EOF" >> "$GITHUB_OUTPUT"
echo "$DIFF" >> "$GITHUB_OUTPUT"
echo "DIFF_EOF" >> "$GITHUB_OUTPUT"
- name: Add Wily PR Comment
uses: marocchino/sticky-pull-request-comment@v2
if: github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.number && steps.wily.outputs.diff != ''
with:
recreate: true
number: ${{ github.event.pull_request.number }}
message: |
```
${{ steps.wily.outputs.diff }}
```
- name: Add Wily PR Comment
uses: marocchino/sticky-pull-request-comment@v2
if: github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.number && steps.wily.outputs.diff == ''
with:
recreate: true
number: ${{ github.event.pull_request.number }}
message: |
```
Wily: No changes in complexity detected.
```