Skip to content
Open
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
10 changes: 5 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v4 # pin:v4

- uses: pnpm/action-setup@v4
- uses: pnpm/action-setup@v4 # pin:v4
with:
run_install: false

- name: Setup Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v4 # pin:v4
with:
node-version: "22.20.0"
cache: "pnpm"
Expand All @@ -31,7 +31,7 @@ jobs:

- name: Upload static files as artifact
id: deployment
uses: actions/upload-pages-artifact@v4
uses: actions/upload-pages-artifact@v4 # pin:v4
with:
path: ./.vitepress/dist

Expand All @@ -47,4 +47,4 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
uses: actions/deploy-pages@v4 # pin:v4
22 changes: 16 additions & 6 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Format

on: push
on:
push:
branches:
- main

jobs:
format-code:
Expand All @@ -10,21 +13,28 @@ jobs:
contents: write

steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v4 # pin:v4
with:
ref: ${{ github.head_ref }}
persist-credentials: true
Comment on lines +16 to 18

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 2526a4b. Removed ref: ${{ github.head_ref }} — it's only populated on pull_request events and would be empty on push, so the default checkout behavior is correct here.


- uses: pnpm/action-setup@v4 # pin:v4
with:
run_install: false

- name: Setup Node.js
uses: actions/setup-node@v6
uses: actions/setup-node@v4 # pin:v4
with:
node-version: 24
cache: pnpm

- name: Install dependencies
run: pnpm install

Comment on lines 24 to 32

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 2526a4b. Replaced npx prettier --write . with pnpm install + pnpm exec prettier --write . so the workflow uses the exact Prettier version pinned in the lockfile. Also added pnpm/action-setup@v4 and cache: pnpm to match the deploy workflow setup.

- name: Run Prettier
run: npx prettier --write .
run: pnpm exec prettier --write .

- name: Auto-commit formatted changes
uses: stefanzweifel/git-auto-commit-action@v7
uses: stefanzweifel/git-auto-commit-action@v5 # pin:v5
with:
commit_message: "style: 自动代码格式化"
commit_user_name: github-actions[bot]
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ node_modules
# VitePress
.vitepress/dist
.vitepress/cache

# Environment secrets
.env
.env.*
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"devDependencies": {
"prettier": "3.6.2",
"vitepress": "2.0.0-alpha.12"
"vitepress": "2.0.0-alpha.17"
},
"packageManager": "pnpm@10.21.0+sha512.da3337267e400fdd3d479a6c68079ac6db01d8ca4f67572083e722775a796788a7a9956613749e000fac20d424b594f7a791a5f4e2e13581c5ef947f26968a40",
"scripts": {
Expand Down
Loading