From c9c1f4efa8bb1682bf62f14dc00eb75d6099f222 Mon Sep 17 00:00:00 2001 From: snomiao Date: Wed, 3 Dec 2025 10:43:28 +0000 Subject: [PATCH] [feat] Add automated PR comment on OSS compliance failure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Post informative comment when OSS compliance checks fail - Include links to workflow logs and documentation - Guide developers on how to fix issues - Only comment on pull requests, not pushes Helps PR authors quickly understand and fix compliance issues. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .github/workflows/ci-oss-compliance.yaml | 32 ++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/.github/workflows/ci-oss-compliance.yaml b/.github/workflows/ci-oss-compliance.yaml index c79bf2d44..024f88566 100644 --- a/.github/workflows/ci-oss-compliance.yaml +++ b/.github/workflows/ci-oss-compliance.yaml @@ -75,3 +75,35 @@ jobs: name: oss-build-artifacts path: dist/ retention-days: 7 + + - name: Post warning comment on PR failure + if: failure() && github.event_name == 'pull_request' + uses: actions/github-script@v7 + with: + script: | + const comment = `## ⚠️ OSS Compliance Check Failed + + The OSS build verification has failed. This usually means: + + **Possible Issues:** + 1. ✗ Proprietary font files (ABCROM) detected in build output + 2. ✗ Telemetry code (Mixpanel) detected in OSS build + 3. ✗ Non-compliant dependency licenses detected + + **What to do:** + 1. Review the [workflow logs](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) for details + 2. Check the uploaded build artifacts for inspection + 3. Ensure tree-shaking is working correctly for cloud-specific code + 4. See [OSS Compliance docs](https://github.com/${{ github.repository }}/blob/${{ github.head_ref || github.ref_name }}/docs/OSS_COMPLIANCE.md) for guidance + + **Build artifacts** have been uploaded for 7 days for your inspection. + + --- + This is an automated message from the OSS Compliance workflow`; + + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: comment + });