Skip to content

Commit c585af7

Browse files
author
shijiashuai
committed
ci: 修复并增强 GitHub Actions workflow
- 添加脚本可执行权限 (chmod +x) - 添加并发控制避免重复运行 - 添加 npm 缓存加速构建 - 优化步骤命名 - 添加文件权限检查步骤
1 parent 5b44e63 commit c585af7

2 files changed

Lines changed: 19 additions & 5 deletions

File tree

.github/workflows/validate.yml

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,32 @@ on:
66
pull_request:
77
branches: [master, main]
88

9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
913
jobs:
1014
validate:
15+
name: Validate MDC Files
1116
runs-on: ubuntu-latest
12-
17+
1318
steps:
14-
- name: Checkout code
19+
- name: Checkout repository
1520
uses: actions/checkout@v4
16-
21+
1722
- name: Setup Node.js
1823
uses: actions/setup-node@v4
1924
with:
2025
node-version: '20'
21-
22-
- name: Validate rule files
26+
cache: 'npm'
27+
28+
- name: Validate MDC rule files
2329
run: node scripts/validate-rules.mjs
30+
31+
- name: Check file permissions
32+
run: |
33+
if [ -x scripts/validate-rules.mjs ]; then
34+
echo "✅ Script has executable permission"
35+
else
36+
echo "⚠️ Script missing executable permission"
37+
fi

scripts/validate-rules.mjs

100644100755
File mode changed.

0 commit comments

Comments
 (0)