lobehub/.github/workflows/claude-translate-comments.yml
Innei fcdaf9d814 🔧 chore: update eslint v2 configuration and suppressions (#12133)
* v2 init

* chore: update eslint suppressions and package dependencies

- Removed several eslint suppressions related to array sorting and reversing from eslint-suppressions.json to clean up the configuration.
- Updated @lobehub/lint package version from 2.0.0-beta.6 to 2.0.0-beta.7 in package.json for improvements and bug fixes.
- Made minor formatting adjustments in vitest.config.mts and various SKILL.md files for better readability and consistency.

Signed-off-by: Innei <tukon479@gmail.com>

* fix: clean up import statements and formatting

- Removed unnecessary whitespace in replaceComponentImports.ts for improved readability.
- Standardized import statements in contextEngineering.ts and createAgentExecutors.ts by adding missing spaces for consistency.

Signed-off-by: Innei <tukon479@gmail.com>

* chore: update eslint suppressions and clean up code formatting

* 🐛 fix: use vi.hoisted for mock variable initialization

Fix TDZ error in persona service test by using vi.hoisted() to ensure
mock variables are available when vi.mock factory runs.

---------

Signed-off-by: Innei <tukon479@gmail.com>
2026-02-11 13:04:48 +08:00

70 lines
2.3 KiB
YAML

name: Claude Translate Non-English Comments
description: Automatically detect and translate non-English comments to English in codebase
on:
schedule:
# Run daily at 02:00 UTC (10:00 Beijing Time)
- cron: '0 2 * * *'
workflow_dispatch:
inputs:
target_module:
description: 'Specific module to translate (e.g., packages/database, apps/desktop/src/modules/auth)'
required: false
type: string
concurrency:
group: translate-comments
cancel-in-progress: false
jobs:
translate-comments:
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: write
pull-requests: write
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 1
- name: Configure Git
run: |
git config --global user.name "claude-bot[bot]"
git config --global user.email "claude-bot[bot]@users.noreply.github.com"
- name: Copy prompts
run: |
mkdir -p /tmp/claude-prompts
cp .claude/prompts/translate-comments.md /tmp/claude-prompts/
cp .claude/prompts/security-rules.md /tmp/claude-prompts/
- name: Run Claude Code for Comment Translation
uses: anthropics/claude-code-action@v1
with:
github_token: ${{ secrets.GH_TOKEN }}
allowed_non_write_users: '*'
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
claude_args: |
--allowedTools "Bash,Read,Edit,Glob,Grep"
--append-system-prompt "$(cat /tmp/claude-prompts/security-rules.md)"
prompt: |
Follow the translation guide located at:
```bash
cat /tmp/claude-prompts/translate-comments.md
```
## Task Assignment
${{ inputs.target_module && format('Process the specified module: {0}', inputs.target_module) || 'Automatically select one module from the target directories that has not been processed recently' }}
## Environment Information
- Repository: ${{ github.repository }}
- Branch: ${{ github.ref_name }}
- Target Module: ${{ inputs.target_module || 'Auto-select' }}
- Run ID: ${{ github.run_id }}
**Start the translation process now.**