Skip to content

Commit 8e94f87

Browse files
author
v_guanglwen
committed
feat: 测测测测
1 parent 6edabcf commit 8e94f87

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ jobs:
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

build/ci.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,17 @@ const ci = require('miniprogram-ci')
33
const fs = require('fs')
44
const packageJson = require('../package.json')
55

6-
const privateKeyContent = process.env.WX_PRIVATE_KEY
7-
if (!privateKeyContent) {
8-
throw new Error('未找到私钥内容,请确保已正确配置 GitHub Secrets')
9-
}
10-
116
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+
}
1317

1418
const project = new ci.Project({
1519
appid: 'wx622bee4f78fa4f5a',

0 commit comments

Comments
 (0)