File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change 14
14
run : |
15
15
mkdir -p ./build
16
16
echo "$WX_PRIVATE_KEY" > ./build/key
17
- node ./build/ci.js
17
+ node ./build/ci.js --skip-key-write
Original file line number Diff line number Diff line change @@ -3,13 +3,17 @@ const ci = require('miniprogram-ci')
3
3
const fs = require ( 'fs' )
4
4
const packageJson = require ( '../package.json' )
5
5
6
- const privateKeyContent = process . env . WX_PRIVATE_KEY
7
- if ( ! privateKeyContent ) {
8
- throw new Error ( '未找到私钥内容,请确保已正确配置 GitHub Secrets' )
9
- }
10
-
11
6
const privateKeyPath = path . resolve ( __dirname , './key' )
12
- fs . writeFileSync ( privateKeyPath , privateKeyContent )
7
+
8
+ // 检查私钥文件是否已存在
9
+ if ( ! fs . existsSync ( privateKeyPath ) ) {
10
+ const privateKeyContent = process . env . WX_PRIVATE_KEY
11
+ if ( ! privateKeyContent ) {
12
+ throw new Error ( '未找到私钥内容,请确保已正确配置 GitHub Secrets' )
13
+ }
14
+ console . log ( '>>>>写入私钥文件:' , privateKeyPath ) ;
15
+ fs . writeFileSync ( privateKeyPath , privateKeyContent )
16
+ }
13
17
14
18
const project = new ci . Project ( {
15
19
appid : 'wx622bee4f78fa4f5a' ,
You can’t perform that action at this time.
0 commit comments