[PR #30744] fix(ci): use repository_dispatch for i18n sync workflow #32951

Closed
opened 2026-02-21 20:52:23 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/30744

State: closed
Merged: Yes


Summary

This PR fixes the translate-i18n-claude.yml workflow which fails when triggered by push events because claude-code-action doesn't support the push event type.

Error from failed run:

##[error]Prepare step failed with error: Unsupported event type: push

Failed run: https://github.com/langgenius/dify/actions/runs/20807450920

Solution

Split the workflow into two files using the repository_dispatch pattern:

1. trigger-i18n-sync.yml (NEW)

  • Listens for push events on main branch with changes to web/i18n/en-US/*.json
  • Detects changed files and generates git diff
  • Sends repository_dispatch event with payload containing:
    • changed_files: Space-separated list of changed file names
    • diff_base64: Base64-encoded git diff for context
    • sync_mode: Always "incremental" for push triggers

2. translate-i18n-claude.yml (MODIFIED)

  • Now listens for repository_dispatch (type: i18n-sync) instead of push
  • Decodes the base64 diff from the trigger workflow
  • Continues to support workflow_dispatch for manual triggers

Why repository_dispatch?

According to the claude-code-action source code, the supported events are:

  • pull_request / pull_request_target
  • pull_request_review / pull_request_review_comment
  • issue_comment / issues
  • workflow_dispatch
  • repository_dispatch
  • schedule
  • workflow_run

The push event is NOT supported.

Test Plan

  • Merge this PR to main
  • Make a change to any web/i18n/en-US/*.json file and push to main
  • Verify trigger-i18n-sync.yml workflow runs and sends repository_dispatch
  • Verify translate-i18n-claude.yml workflow is triggered and runs successfully
  • Test manual trigger via workflow_dispatch still works

Fixes #30743

**Original Pull Request:** https://github.com/langgenius/dify/pull/30744 **State:** closed **Merged:** Yes --- ## Summary This PR fixes the `translate-i18n-claude.yml` workflow which fails when triggered by push events because `claude-code-action` doesn't support the `push` event type. **Error from failed run:** ``` ##[error]Prepare step failed with error: Unsupported event type: push ``` **Failed run:** https://github.com/langgenius/dify/actions/runs/20807450920 ## Solution Split the workflow into two files using the `repository_dispatch` pattern: ### 1. `trigger-i18n-sync.yml` (NEW) - Listens for `push` events on main branch with changes to `web/i18n/en-US/*.json` - Detects changed files and generates git diff - Sends `repository_dispatch` event with payload containing: - `changed_files`: Space-separated list of changed file names - `diff_base64`: Base64-encoded git diff for context - `sync_mode`: Always "incremental" for push triggers ### 2. `translate-i18n-claude.yml` (MODIFIED) - Now listens for `repository_dispatch` (type: `i18n-sync`) instead of `push` - Decodes the base64 diff from the trigger workflow - Continues to support `workflow_dispatch` for manual triggers ## Why `repository_dispatch`? According to the [claude-code-action source code](https://github.com/anthropics/claude-code-action/blob/main/src/github/context.ts), the supported events are: - `pull_request` / `pull_request_target` - `pull_request_review` / `pull_request_review_comment` - `issue_comment` / `issues` - `workflow_dispatch` - **`repository_dispatch`** ✓ - `schedule` - `workflow_run` The `push` event is NOT supported. ## Test Plan - [ ] Merge this PR to main - [ ] Make a change to any `web/i18n/en-US/*.json` file and push to main - [ ] Verify `trigger-i18n-sync.yml` workflow runs and sends `repository_dispatch` - [ ] Verify `translate-i18n-claude.yml` workflow is triggered and runs successfully - [ ] Test manual trigger via `workflow_dispatch` still works Fixes #30743
yindo added the pull-request label 2026-02-21 20:52:23 -05:00
yindo closed this issue 2026-02-21 20:52:23 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#32951