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 1414 run : |
1515 mkdir -p ./build
1616 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')
33const fs = require ( 'fs' )
44const packageJson = require ( '../package.json' )
55
6- const privateKeyContent = process . env . WX_PRIVATE_KEY
7- if ( ! privateKeyContent ) {
8- throw new Error ( '未找到私钥内容,请确保已正确配置 GitHub Secrets' )
9- }
10-
116const 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+ }
1317
1418const project = new ci . Project ( {
1519 appid : 'wx622bee4f78fa4f5a' ,
You can’t perform that action at this time.
0 commit comments