diff --git a/.github/workflows/beta-pack.yml b/.github/workflows/beta-pack.yml index 6ce8dc085c..96ea6ac1b1 100644 --- a/.github/workflows/beta-pack.yml +++ b/.github/workflows/beta-pack.yml @@ -5,6 +5,9 @@ on: branches: - beta +env: + IS_CI: 'true' + jobs: # CheckCode: # name: Lint Code diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ccaa2c62b5..68a646cd8c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,6 +5,9 @@ on: branches: - master +env: + IS_CI: 'true' + jobs: # CheckCode: # name: Lint Code diff --git a/build-config/renderer/webpack.config.prod.js b/build-config/renderer/webpack.config.prod.js index b63bd0b0f1..873ddf2fae 100644 --- a/build-config/renderer/webpack.config.prod.js +++ b/build-config/renderer/webpack.config.prod.js @@ -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 {}