Skip to content

feat(ci): persist pyscn analyze report and post PR comment - #25

Merged
dlstadther merged 3 commits into
mainfrom
dlstadther/pyscn-pr-comment
Sep 12, 2026
Merged

feat(ci): persist pyscn analyze report and post PR comment#25
dlstadther merged 3 commits into
mainfrom
dlstadther/pyscn-pr-comment

Conversation

@dlstadther

@dlstadther dlstadther commented Sep 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • New .github/workflows/quality.yml runs pyscn's whole quality-analysis flow (check gate, analyze --html report, artifact upload, PR comment) as its own workflow, gated on paths: ['**/*.py', '.pyscn.toml', 'pyproject.toml'] for both pull_request and push — so it's skipped entirely on PRs/pushes that touch no Python (per docs.codescan.dev/integrations/ci-cd/#github-actions).
  • On pull_request runs from the same repo (skips forked PRs, whose GITHUB_TOKEN can't post comments), pipe pyscn analyze --json --output - through jq into a markdown summary and post it via gh pr comment (per docs.codescan.dev/integrations/ci-cd/#pr-comment-from-json).
  • Removed the pyscn steps from tests.yml's lint job (now back to just Ruff + Sqlfluff) since they moved to quality.yml.
  • Added lint-quality-report Makefile target so the report can also be generated locally.
  • push trigger targets main (repo's actual trunk branch, not master/develop).

Test plan

  • make lint-quality-report runs locally and produces .pyscn/reports/*.html
  • pyscn analyze --json --output - . | jq -r '...' produces the expected markdown summary
  • Both workflow YAML files validated with yaml.safe_load
  • CI ran on this PR — quality workflow triggered, posted the pyscn report comment

🤖 Generated with Claude Code

https://claude.ai/code/session_01HL1T9zdfnCg1dcTcDfDRSt

Add pyscn analyze --html report generation + upload-artifact so full
reports survive past the job. On pull_request runs (same-repo only,
so forked-PR tokens don't hit a permissions error), pipe the JSON
report through jq into a PR comment via gh.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HL1T9zdfnCg1dcTcDfDRSt
@github-actions

Copy link
Copy Markdown

pyscn report

  • Health Score: 88 / 100 (B)
  • Complexity: 100
  • Dead code: 100

…kflow

Move the pyscn check/report/upload/comment steps out of tests.yml's
lint job into a new quality.yml workflow, gated on pull_request/push
paths (py files, .pyscn.toml, pyproject.toml) per pyscn's own CI docs
example. Keeps the analysis from running on PRs/pushes that touch no
Python, without skipping unrelated lint/test/build jobs too.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HL1T9zdfnCg1dcTcDfDRSt
Comment thread .github/workflows/quality.yml Outdated
master/develop don't exist in this repo — trunk is main.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HL1T9zdfnCg1dcTcDfDRSt
@dlstadther
dlstadther merged commit 67c4c54 into main Sep 12, 2026
5 checks passed
@dlstadther
dlstadther deleted the dlstadther/pyscn-pr-comment branch September 12, 2026 01:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant