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 24
24
run : npm run init
25
25
- name : Upload MiniProgram
26
26
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)
7
7
const __dirname = path . dirname ( __filename )
8
8
const privateKeyPath = path . resolve ( __dirname , './key' )
9
9
10
+ console . log ( 'Private key exists:' , fs . existsSync ( privateKeyPath ) )
11
+ console . log ( 'Private key content length:' , fs . readFileSync ( privateKeyPath ) . length )
12
+
10
13
// 检查私钥文件是否已存在
11
14
if ( ! fs . existsSync ( privateKeyPath ) ) {
12
15
console . log ( "hello word WZY" ) ;
You can’t perform that action at this time.
0 commit comments