Skip to content

feat:合并主分支代码检查 #176

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 16 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
],
rules: {
'arrow-parens': 'off',
'eqeqeq': 'off',

Check warning on line 25 in .eslintrc.js

View workflow job for this annotation

GitHub Actions / lint

Unnecessarily quoted property 'eqeqeq' found
'no-bitwise': 'off',
'comma-dangle': [
'error',
'only-multiline'
Expand All @@ -41,6 +43,8 @@
ignore: ['^[^.]']
}
],
'max-len': 'off',
'no-unused-vars': 'off',
'import/prefer-default-export': 'off',
'linebreak-style': 'off',
'no-catch-shadow': 'error',
Expand Down Expand Up @@ -96,4 +100,4 @@
worker: true,
getApp: true
}
}
}

Check failure on line 103 in .eslintrc.js

View workflow job for this annotation

GitHub Actions / lint

Newline required at end of file but not found
20 changes: 15 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
name: WeChat MiniProgram Demo CI/CD

on:
push:
branches:
- master
pull_request:
types: [closed]
branches:
- master

permissions:
contents: read
actions: read

jobs:
upload:
if: github.event.pull_request.merged == true && github.repository == 'wechat-miniprogram/miniprogram-demo'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -29,7 +34,12 @@ jobs:
env:
WX_PRIVATE_KEY: ${{ secrets.WX_PRIVATE_KEY }}
run: |
# 验证密钥是否为空
if [ -z "$WX_PRIVATE_KEY" ]; then
echo "❌ 错误: WX_PRIVATE_KEY 为空,请检查 GitHub Secrets 设置"
exit 1
fi
mkdir -p ./build
echo "$WX_PRIVATE_KEY" > ./build/key
chmod +x ./build/ci.js
node ./build/ci.js --skip-key-write
echo "$WX_PRIVATE_KEY" | xxd

19 changes: 19 additions & 0 deletions .github/workflows/pr-lint-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: PR Lint Check

on:
pull_request:
branches: [master]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '16'
- name: Install dependencies
run: npm install
- name: Run lint
run: npm run lint
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"name": "miniprogram-demo",
"version": "1.0.0",
"description": "WeChat miniprogram demo",
"type": "module",
"scripts": {
"init": "npm run sync && cd cloudfunctions/ && npm i --production && cd ../miniprogram/ && npm i --production",
"lint": "eslint .",
Expand Down
Loading