-
-
Notifications
You must be signed in to change notification settings - Fork 107
[WIP] chore: add sync vitest docs script #839
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
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,38 @@ | ||||||
| name: Sync Vitest Docs | ||||||
|
|
||||||
| on: | ||||||
| workflow_dispatch: | ||||||
|
|
||||||
| jobs: | ||||||
| sync-docs: | ||||||
| runs-on: ubuntu-latest | ||||||
|
|
||||||
| steps: | ||||||
| - name: Checkout docs-cn repository | ||||||
| uses: actions/checkout@v4 | ||||||
| with: | ||||||
| repository: vitest-dev/docs-cn | ||||||
| ref: dev | ||||||
| token: ${{ secrets.GITHUB_TOKEN }} | ||||||
|
|
||||||
| - name: Setup Node.js | ||||||
| uses: actions/setup-node@v4 | ||||||
| with: | ||||||
| node-version: '20' | ||||||
|
|
||||||
| - name: Install dependencies | ||||||
| run: | | ||||||
| npm install shelljs @octokit/rest colors | ||||||
| - name: Run sync script | ||||||
| env: | ||||||
| GITHUB_USERNAME: elonehoo | ||||||
|
||||||
| GITHUB_USERNAME: elonehoo | |
| GITHUB_USERNAME: ${{ github.actor }} |
Copilot
AI
Dec 9, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using secrets.GITHUB_TOKEN in a workflow_dispatch event will have limited permissions and may not be able to push to the repository or create pull requests. Consider using a Personal Access Token (PAT) stored as a repository secret with appropriate permissions:
token: ${{ secrets.PAT_TOKEN }}
Copilot
AI
Dec 9, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The hardcoded email "[email protected]" should be dynamically generated based on the GitHub username or use GitHub Actions context:
GITHUB_EMAIL: ${{ github.actor }}@users.noreply.github.com| GITHUB_EMAIL: elonehoo@users.noreply.github.com | |
| GITHUB_EMAIL: ${{ github.actor }}@users.noreply.github.com |
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -15,7 +15,8 @@ | |||
| "lint": "eslint --cache .", | ||||
| "lint:fix": "eslint . --fix", | ||||
| "generate-pwa-icons": "pwa-assets-generator", | ||||
| "prepare": "simple-git-hooks" | ||||
| "prepare": "simple-git-hooks", | ||||
| "sync": "node scripts/sync-vitest-docs.mjs" | ||||
| }, | ||||
| "dependencies": { | ||||
| "@vueuse/core": "latest", | ||||
|
|
@@ -45,6 +46,9 @@ | |||
| "lint-staged": "^16.2.6", | ||||
| "ofetch": "^1.4.1", | ||||
| "pathe": "^2.0.3", | ||||
| "shelljs": "^0.8.5", | ||||
| "@octokit/rest": "^21.0.2", | ||||
| "colors": "^1.4.0", | ||||
|
||||
| "colors": "^1.4.0", |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Installing dependencies globally with
npm installin the workflow is inefficient since the repository already has a package.json with these dependencies. Use the project's package manager instead: