Download scripts/ci-change-risk.mjs from xjackkx/s2: direct link, hf CLI and curl.
- Browser
- Download file 499 Bytes
-
https://huggingface.co/spaces/xjackkx/s2/resolve/main/scripts/ci-change-risk.mjs
- Command line
-
hf download hf://spaces/xjackkx/s2/scripts/ci-change-risk.mjs
-
curl -L -o ci-change-risk.mjs https://huggingface.co/spaces/xjackkx/s2/resolve/main/scripts/ci-change-risk.mjs
499 Bytes
| const DOC_ONLY_ROOT_FILES = new Set(["LICENSE", "README.md", "README.zh.md"]); | |
| export function classifyChangedFiles(files) { | |
| const normalized = files | |
| .map((file) => | |
| String(file || "") | |
| .replaceAll("\\", "/") | |
| .trim(), | |
| ) | |
| .filter(Boolean); | |
| if (!normalized.length) return "runtime"; | |
| return normalized.every(isDocumentationOnlyPath) ? "docs" : "runtime"; | |
| } | |
| function isDocumentationOnlyPath(path) { | |
| if (DOC_ONLY_ROOT_FILES.has(path)) return true; | |
| return path.startsWith("docs/"); | |
| } | |