Skip to content

feat: 03_ASCII_art_banner #8

feat: 03_ASCII_art_banner

feat: 03_ASCII_art_banner #8

name: Code Quality Report
on:
pull_request:
branches: [main]
jobs:
quality-report:
name: Generate Quality Report
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install black ruff
- name: Run Black check
run: black --check . 2>&1 | tee black-output.txt || true
- name: Run Ruff check
run: ruff check . 2>&1 | tee ruff-output.txt || true
- name: Generate summary report
run: |
{
echo "## Code Quality Report"
echo ""
echo "### Black Formatting"
if grep -q "would reformat" black-output.txt; then
echo "❌ Some files need formatting"
else
echo "✅ All files are properly formatted"
fi
echo ""
echo "### Ruff Linting"
if [ -s ruff-output.txt ]; then
echo "❌ Linting issues found:"
cat ruff-output.txt
else
echo "✅ No linting issues"
fi
} > report.md
- name: Comment PR with report
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const report = fs.readFileSync('report.md', 'utf8');
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: report
});