feat: make OSS license audit runnable locally#1021
Conversation
|
Caution Review failedPull request was closed or merged during review WalkthroughThe pull request introduces a complete license audit automation pipeline by externalizing the Claude prompt to a separate file, refactoring the GitHub Actions workflow to simplify comment generation logic, and adding orchestration scripts that fetch license data, summarize it, and invoke Claude for compliance auditing with comprehensive validation. Changes
Sequence Diagram(s)sequenceDiagram
participant GHA as GitHub Actions
participant Node as Node Scripts
participant Claude as Claude CLI
participant FS as File System
GHA->>Node: Execute fetchLicenses.mjs
Node->>FS: Read package.json
Node->>FS: Write oss-licenses.json
GHA->>Node: Execute summarizeLicenses.mjs
Node->>FS: Read oss-licenses.json
Node->>FS: Write summary output
GHA->>FS: Read licenseAuditPrompt.txt
FS-->>GHA: Prompt contents
GHA->>Claude: Run audit with prompt + summary
Claude->>Claude: Analyze licenses & classify copyleft
Claude->>FS: Write license-audit-result.json
GHA->>FS: Validate license-audit-result.json exists
FS-->>GHA: Result file contents
GHA->>GHA: Extract status & summary counts
alt status == FAIL
GHA->>GHA: Format failure reasons
GHA-->>GHA: Exit with error
else status == PASS
GHA-->>GHA: Report success
end
GHA->>FS: Comment on PR (conditional)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@msukkari your pull request is missing a changelog! |
License Audit❌ Audit failed to produce results. Check the workflow logs for details. |
Summary by CodeRabbit