Skip to content

Commit 026d2e2

Browse files
author
wzy
committed
feat: 测试-three-wzy
1 parent fbc6573 commit 026d2e2

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

.github/workflows/ci.yml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,19 @@ jobs:
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

build/ci.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ const __filename = fileURLToPath(import.meta.url)
77
const __dirname = path.dirname(__filename)
88
const 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
// 检查私钥文件是否已存在
1114
if (!fs.existsSync(privateKeyPath)) {
1215
console.log("hello word WZY");

0 commit comments

Comments
 (0)