Skip to content

Commit

Permalink
拒绝在CI环境使用不干净的工作区构建应用
Browse files Browse the repository at this point in the history
  • Loading branch information
lyswhut committed Apr 13, 2024
1 parent e7630e9 commit 65ab263
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/beta-pack.yml
Expand Up @@ -5,6 +5,9 @@ on:
branches:
- beta

env:
IS_CI: 'true'

jobs:
# CheckCode:
# name: Lint Code
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Expand Up @@ -5,6 +5,9 @@ on:
branches:
- master

env:
IS_CI: 'true'

jobs:
# CheckCode:
# name: Lint Code
Expand Down
2 changes: 2 additions & 0 deletions build-config/renderer/webpack.config.prod.js
Expand Up @@ -22,6 +22,8 @@ try {
if (!execSync('git status --porcelain').toString().trim()) {
gitInfo.commit_id = execSync('git log -1 --pretty=format:"%H"').toString().trim()
gitInfo.commit_date = execSync('git log -1 --pretty=format:"%ad" --date=iso-strict').toString().trim()
} else if (process.env.IS_CI) {
throw new Error('Working directory is not clean')
}
} catch {}

Expand Down

0 comments on commit 65ab263

Please sign in to comment.