From 65ab26365d7cd2ef6f3ab94c5b76cd6992a56fc5 Mon Sep 17 00:00:00 2001 From: lyswhut Date: Sat, 13 Apr 2024 18:59:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8B=92=E7=BB=9D=E5=9C=A8CI=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E4=B8=8D=E5=B9=B2=E5=87=80=E7=9A=84=E5=B7=A5?= =?UTF-8?q?=E4=BD=9C=E5=8C=BA=E6=9E=84=E5=BB=BA=E5=BA=94=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/beta-pack.yml | 3 +++ .github/workflows/release.yml | 3 +++ build-config/renderer/webpack.config.prod.js | 2 ++ 3 files changed, 8 insertions(+) diff --git a/.github/workflows/beta-pack.yml b/.github/workflows/beta-pack.yml index 6ce8dc08..96ea6ac1 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 ccaa2c62..68a646cd 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 b63bd0b0..873ddf2f 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 {}