File tree Expand file tree Collapse file tree 2 files changed +19
-6
lines changed Expand file tree Collapse file tree 2 files changed +19
-6
lines changed Original file line number Diff line number Diff line change 2424 run : npm run init
2525 - name : Upload MiniProgram
2626 env :
27- WX_PRIVATE_KEY : ${{ secrets.WX_PRIVATE_KEY }}
28- run : |
29- mkdir -p ./build
30- echo "$WX_PRIVATE_KEY" > ./build/key
31- chmod +x ./build/ci.js
32- node ./build/ci.js --skip-key-write
27+ WX_PRIVATE_KEY : ${{ secrets.WX_PRIVATE_KEY }}
28+ run : |
29+ mkdir -p ./build
30+
31+ # 打印私钥长度和内容(仅调试用)
32+ echo "WX_PRIVATE_KEY 长度:${#WX_PRIVATE_KEY}"
33+
34+ # 可选:打印部分内容(避免敏感信息泄露)
35+ echo "$WX_PRIVATE_KEY" | head -c 50 && echo "... (只显示前50字符)"
36+
37+ # 写入私钥文件
38+ echo "$WX_PRIVATE_KEY" > ./build/key
39+
40+ # 继续执行上传脚本
41+ chmod +x ./build/ci.js
42+ node ./build/ci.js --skip-key-write
Original file line number Diff line number Diff line change @@ -7,6 +7,9 @@ const __filename = fileURLToPath(import.meta.url)
77const __dirname = path . dirname ( __filename )
88const privateKeyPath = path . resolve ( __dirname , './key' )
99
10+ console . log ( 'Private key exists:' , fs . existsSync ( privateKeyPath ) )
11+ console . log ( 'Private key content length:' , fs . readFileSync ( privateKeyPath ) . length )
12+
1013// 检查私钥文件是否已存在
1114if ( ! fs . existsSync ( privateKeyPath ) ) {
1215 console . log ( "hello word WZY" ) ;
You can’t perform that action at this time.
0 commit comments