Skip to content

ci: add post-merge SCANOSS license & BOM check - #1184

Merged
anhappdev merged 3 commits into
mlcommons:masterfrom
arav-agarwal2:feat/scanoss
Oct 21, 2026
Merged

anhappdev merged 3 commits into
mlcommons:masterfrom
arav-agarwal2:feat/scanoss

Conversation

@arav-agarwal2

@arav-agarwal2 arav-agarwal2 commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Hello folks! As part of AI-code policy changes at MLC, we're trying to roll out AI-generated code checks to catch if licensed code from bad licenses ends up in the codebase.

This PR adds a SCANOSS license & BOM check that runs after merge to master (and on manual dispatch). It's informational only and never blocks.

  • .github/workflows/scanoss.yml: scans only the files changed in the pushed range (before..sha), not the whole tree, using scanoss-py against api.osskb.org. It then:
    • converts the results to a CycloneDX BOM
    • runs the copyleft and undeclared-component inspections (these steps use continue-on-error)
    • writes a report to the run's Summary: a file → component / match % / license table that flags copyleft, non-commercial, or non-permissive licenses, plus the remaining per-key osskb quota when SCANOSS_API_KEY is set
    • uploads everything in scanoss-reports/ as an artifact that's kept for 30 days
  • .github/scanoss.json: scan settings that skip tests, vendored and third-party dirs, node_modules, and generated protobuf files, and declare pkg:github/mlcommons/mobile_app_open in the BOM.

Review feedback

@anhappdev — "Please pin any GitHub actions to commit SHA." Done in 901cd7a. All three actions are now pinned to a full commit SHA with the version in a trailing comment, matching the form used throughout .github/workflows:

Action Was Now
actions/checkout @v4 @df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
actions/setup-python @v5 @5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
actions/upload-artifact @v4 @043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1

checkout and upload-artifact reuse the exact SHAs this repo already pins elsewhere, so there's one pinned version of each action across the tree rather than two. setup-python isn't used anywhere else here, so it's pinned at the current release; the only input v7 removed is pip-install, which this workflow never set.

One thing still unpinned, and I'd like a steer: the pip install scanoss step floats to whatever is current on PyPI. Pinning it (scanoss==<version>) would close the same supply-chain gap the SHA pins close, at the cost of needing a bump to pick up checker improvements. Happy to pin it if you'd prefer that — say the word.

@anhappdev — "For setting the SCANOSS_API_KEY please contact @mlcommons/admin." Thanks — will do once this merges. Without the key the workflow still runs; it just falls back to the shared osskb rate limit and skips the per-key quota table in the Summary.

@arav-agarwal2
arav-agarwal2 requested review from a team and anhappdev as code owners September 29, 2026 16:24
@github-actions

Copy link
Copy Markdown

MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅

@freedomtan

Copy link
Copy Markdown
Contributor

@anhappdev please take care of this.

@anhappdev anhappdev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. For setting the SCANOSS_API_KEY please contact @mlcommons/admin

@anhappdev anhappdev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arav-agarwal2 Please pin any Github actions to commit SHA.

@freedomtan

Copy link
Copy Markdown
Contributor

@arav-agarwal2 ping

A floating tag is a moving target: whoever controls the action's repo can
repoint v4 at any commit, and this job runs on master with the SCANOSS
API key in scope. Pin each action to a full commit SHA with the version
in a trailing comment, the same form the rest of .github/workflows uses.

checkout and upload-artifact reuse the SHAs already pinned elsewhere in
this repo (v6.0.3 / v7.0.1) rather than introducing a second pinned
version of the same action; setup-python goes to v7.0.0, whose only
removed input, pip-install, this workflow never used.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@anhappdev
anhappdev merged commit 846c58d into mlcommons:master Oct 21, 2026
22 of 29 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 21, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants