Skip to content

feat(ci): auto-translate workflow & remove local git hooks#64

Merged
dbfx merged 4 commits intomainfrom
t3code/auto-translate-on-git
Mar 24, 2026
Merged

feat(ci): auto-translate workflow & remove local git hooks#64
dbfx merged 4 commits intomainfrom
t3code/auto-translate-on-git

Conversation

@dbfx
Copy link
Contributor

@dbfx dbfx commented Mar 24, 2026

Summary

  • Add a GitHub Actions workflow that automatically runs translations when English locale files change in a PR
  • Remove local Husky git hooks (pre-commit and commit-msg) — no more slow local commits
  • Keep the commitlint CI workflow so PR commit messages are still validated in CI

How it works

  • When a PR modifies files in src/renderer/src/locales/en/, the workflow runs node scripts/translate.js
  • If translations changed, it commits chore: auto-update translations back to the PR branch
  • Can also be triggered manually from the Actions tab
  • Skips fork PRs (no access to secrets)

Setup required

Add OPENAI_API_KEY as a repository secret in Settings → Secrets → Actions

Test plan

  • Add OPENAI_API_KEY repo secret
  • Create a test PR that modifies an English locale file
  • Verify the workflow runs and commits updated translations
  • Verify local commits no longer trigger husky hooks

🤖 Generated with Claude Code

dbfx added 2 commits March 24, 2026 10:13
- Replace local commit hooks with a PR/comment-triggered translation workflow
- Remove commitlint and husky dependencies and config
- Auto-commit generated locale updates back to the branch
- Add conventional commit linting via `@commitlint`
- Run commitlint on pull requests against `main`
Remove the issue_comment trigger which caused a CodeQL security warning
(untrusted checkout in privileged context). Also skip fork PRs since
they won't have access to the OPENAI_API_KEY secret.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cfb7802c92

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@dbfx dbfx changed the title Add auto-translate workflow and remove Husky hooks feat(ci): auto-translate workflow & remove local git hooks Mar 24, 2026
Move OPENAI_API_KEY to job-level env and add conditionals to all steps
so the workflow succeeds with a warning instead of failing when the
secret is missing (e.g. fork PRs that slip past the repo check).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dbfx dbfx merged commit a7ccf64 into main Mar 24, 2026
8 of 9 checks passed
@dbfx dbfx deleted the t3code/auto-translate-on-git branch March 24, 2026 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant