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 11name : WeChat MiniProgram Demo CI/CD
22
33on :
4- pull_request :
5- types : [closed]
4+ push :
65 branches :
7- - master
6+ - feat-ce
87jobs :
98 upload :
10- if : github.event.pull_request.merged == true && github.repository == 'wechat-miniprogram/miniprogram-demo'
119 runs-on : ubuntu-latest
1210 steps :
1311 - uses : actions/checkout@v4
2927 env :
3028 WX_PRIVATE_KEY : ${{ secrets.WX_PRIVATE_KEY }}
3129 run : |
30+ # 验证密钥是否为空
31+ if [ -z "$WX_PRIVATE_KEY" ]; then
32+ echo "❌ 错误: WX_PRIVATE_KEY 为空,请检查 GitHub Secrets 设置"
33+ exit 1
34+ fi
3235 mkdir -p ./build
3336 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')
1010// 检查私钥文件是否已存在
1111if ( ! fs . existsSync ( privateKeyPath ) ) {
1212 console . log ( "hello word WZY" ) ;
13+ console . log ( "hello word WZY two" ) ;
1314 const privateKeyContent = process . env . WX_PRIVATE_KEY
1415 if ( ! privateKeyContent ) {
1516 throw new Error ( '未找到私钥内容,请确保已正确配置 GitHub Secrets' )
You can’t perform that action at this time.
0 commit comments