fd423770d8
修复 Agent 失败展示变更中的 import 排序错误 统一 CI 与 master pre-push 的 Repository checks 入口 让 staged JS 和 TS 自动执行 ESLint 修复与 Prettier 补充部分暂存、忽略文件和待推 SHA 回归测试 同步分支保护与本地门禁流程文档
26 lines
774 B
Bash
Executable File
26 lines
774 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
base_ref="${SPACETIME_SCHEMA_BASE_REF:-${1:-}}"
|
|
head_ref="${REPOSITORY_CI_HEAD_REF:-${2:-HEAD}}"
|
|
|
|
if [[ -z "${base_ref}" ]]; then
|
|
echo '[repository-ci] 缺少比较基线;请设置 SPACETIME_SCHEMA_BASE_REF 或传入第一个参数。' >&2
|
|
exit 1
|
|
fi
|
|
|
|
git cat-file -e "${base_ref}^{commit}" 2>/dev/null || {
|
|
echo "[repository-ci] 比较基线不可用: ${base_ref}" >&2
|
|
exit 1
|
|
}
|
|
git cat-file -e "${head_ref}^{commit}" 2>/dev/null || {
|
|
echo "[repository-ci] 待检查提交不可用: ${head_ref}" >&2
|
|
exit 1
|
|
}
|
|
|
|
echo "[repository-ci] base=${base_ref} head=$(git rev-parse "${head_ref}")"
|
|
SPACETIME_SCHEMA_BASE_REF="${base_ref}" npm run lint
|
|
npm run build
|
|
npm run check:content
|
|
git diff --check "${base_ref}"..."${head_ref}"
|