-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8afbfd3
commit edde1ef
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Generate pnpm-lock.yaml | ||
|
||
on: | ||
push: | ||
branches: | ||
- main # 或者你希望触发的分支 | ||
pull_request: | ||
branches: | ||
- main # 或者你希望触发的分支 | ||
|
||
jobs: | ||
install-dependencies: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '20' # 设置你需要的 Node.js 版本,或者使用 .nvmrc 配置 | ||
|
||
- name: Install pnpm | ||
run: | | ||
npm install -g pnpm # 安装 pnpm | ||
- name: Install dependencies and generate pnpm-lock.yaml | ||
run: | | ||
pnpm install # 这会自动生成 pnpm-lock.yaml | ||
- name: Commit pnpm-lock.yaml | ||
run: | | ||
git config --global user.name "Allen Zhang" | ||
git config --global user.email "[email protected]" | ||
git add . | ||
git commit -m "feat: update pnpm-lock.yaml" || echo "No changes to commit" | ||
git push |