chore: 安全升级并完善 CI/测试
- 升级 js-yaml 修复生产依赖漏洞 - 新增 CI:lint/test/build - 增加书签处理单测与可测性导出"- 生成器补充 config/user 缺失提示 - 增加 lint/format/check 脚本与 Prettier 配置 - 统一行尾策略并支持书签确定性输出"
This commit is contained in:
31
.github/workflows/ci.yml
vendored
Normal file
31
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
build_test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '18'
|
||||
cache: 'npm'
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Lint
|
||||
run: npm run lint
|
||||
|
||||
- name: Unit tests
|
||||
run: npm test
|
||||
|
||||
- name: Build
|
||||
run: npm run build
|
||||
15
.github/workflows/deploy.yml
vendored
15
.github/workflows/deploy.yml
vendored
@@ -50,6 +50,8 @@ jobs:
|
||||
|
||||
- name: Process bookmark files
|
||||
if: steps.check_bookmark_files.outputs.found == 'true'
|
||||
env:
|
||||
MENAV_BOOKMARKS_DETERMINISTIC: '1'
|
||||
run: |
|
||||
echo "Processing bookmark files..."
|
||||
node src/bookmark-processor.js
|
||||
@@ -98,7 +100,16 @@ jobs:
|
||||
git commit -m "Add bookmarks configuration from imported bookmarks"
|
||||
fi
|
||||
|
||||
# Also check for navigation file changes
|
||||
# Also check for site.yml changes(导航已合并到 site.yml)
|
||||
if [ -f config/user/site.yml ]; then
|
||||
if ! git diff --quiet config/user/site.yml; then
|
||||
echo "config/user/site.yml has changes, committing..."
|
||||
git add config/user/site.yml
|
||||
git commit -m "Update site configuration for bookmarks"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Also check for legacy navigation file changes
|
||||
if [ -f config/user/navigation.yml ]; then
|
||||
if ! git diff --quiet config/user/navigation.yml; then
|
||||
echo "config/user/navigation.yml has changes, committing..."
|
||||
@@ -194,4 +205,4 @@ jobs:
|
||||
|
||||
- name: Deploy to GitHub Pages
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@v4
|
||||
uses: actions/deploy-pages@v4
|
||||
|
||||
Reference in New Issue
Block a user