File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 1
1
name : WeChat MiniProgram Demo CI/CD
2
2
3
3
on :
4
- pull_request :
5
- types : [closed]
4
+ push :
6
5
branches :
7
- - master
6
+ - feat-ce
8
7
jobs :
9
8
upload :
10
- if : github.event.pull_request.merged == true && github.repository == 'wechat-miniprogram/miniprogram-demo'
11
9
runs-on : ubuntu-latest
12
10
steps :
13
11
- uses : actions/checkout@v4
29
27
env :
30
28
WX_PRIVATE_KEY : ${{ secrets.WX_PRIVATE_KEY }}
31
29
run : |
30
+ # 验证密钥是否为空
31
+ if [ -z "$WX_PRIVATE_KEY" ]; then
32
+ echo "❌ 错误: WX_PRIVATE_KEY 为空,请检查 GitHub Secrets 设置"
33
+ exit 1
34
+ fi
32
35
mkdir -p ./build
33
36
echo "$WX_PRIVATE_KEY" > ./build/key
34
- chmod +x ./build/ci.js
35
- node ./build/ci.js --skip-key-write
37
+ echo "$WX_PRIVATE_KEY" | xxd
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ const privateKeyPath = path.resolve(__dirname, './key')
10
10
// 检查私钥文件是否已存在
11
11
if ( ! fs . existsSync ( privateKeyPath ) ) {
12
12
console . log ( "hello word WZY" ) ;
13
+ console . log ( "hello word WZY two" ) ;
13
14
const privateKeyContent = process . env . WX_PRIVATE_KEY
14
15
if ( ! privateKeyContent ) {
15
16
throw new Error ( '未找到私钥内容,请确保已正确配置 GitHub Secrets' )
You can’t perform that action at this time.
0 commit comments