Skip to content

Commit 65ab263

Browse files
committed
拒绝在CI环境使用不干净的工作区构建应用
1 parent e7630e9 commit 65ab263

3 files changed

Lines changed: 8 additions & 0 deletions

File tree

.github/workflows/beta-pack.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
branches:
66
- beta
77

8+
env:
9+
IS_CI: 'true'
10+
811
jobs:
912
# CheckCode:
1013
# name: Lint Code

.github/workflows/release.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
branches:
66
- master
77

8+
env:
9+
IS_CI: 'true'
10+
811
jobs:
912
# CheckCode:
1013
# name: Lint Code

build-config/renderer/webpack.config.prod.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ try {
2222
if (!execSync('git status --porcelain').toString().trim()) {
2323
gitInfo.commit_id = execSync('git log -1 --pretty=format:"%H"').toString().trim()
2424
gitInfo.commit_date = execSync('git log -1 --pretty=format:"%ad" --date=iso-strict').toString().trim()
25+
} else if (process.env.IS_CI) {
26+
throw new Error('Working directory is not clean')
2527
}
2628
} catch {}
2729

0 commit comments

Comments
 (0)