拒绝在CI环境使用不干净的工作区构建应用
parent
e7630e98d9
commit
65ab26365d
|
@ -5,6 +5,9 @@ on:
|
|||
branches:
|
||||
- beta
|
||||
|
||||
env:
|
||||
IS_CI: 'true'
|
||||
|
||||
jobs:
|
||||
# CheckCode:
|
||||
# name: Lint Code
|
||||
|
|
|
@ -5,6 +5,9 @@ on:
|
|||
branches:
|
||||
- master
|
||||
|
||||
env:
|
||||
IS_CI: 'true'
|
||||
|
||||
jobs:
|
||||
# CheckCode:
|
||||
# name: Lint Code
|
||||
|
|
|
@ -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 {}
|
||||
|
||||
|
|
Loading…
Reference in New Issue