Skip to content
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

chore: Keeps README translations synchronized #1432

Merged
merged 13 commits into from
Dec 24, 2024

Conversation

0xJord4n
Copy link
Contributor

Relates to:

chore: Keeps README translations synchronized

Risks

Medium. Changes to the main README file could affect all translated versions, and any errors in the translation script could propagate incorrect information across all language files.

Background

What does this PR do?

Implements a script that uses GPT-o4 to automatically update and translate all the README files whenever the English README.md file changes. Integrates with GitHub CI for automation.

What kind of change is this?

  • Features (non-breaking change which adds functionality)

Documentation changes needed?

Not applicable.

Testing

Where should a reviewer start?

Start with the new script implementation and its integration with GitHub Actions for CI.

Detailed testing steps

  • Test the script by making a change to the English README.md file.
  • Verify that the changes are correctly propagated to all translated README files.
  • Ensure that the GitHub CI pipeline runs successfully without errors.

Screenshots

Before

Not applicable.

After

Not applicable.

Deploy Notes

No special deployment instructions needed.

Database changes

None.

Deployment instructions

Before the workflow can run, you need to set up the following secrets in your GitHub repository:

  1. GH_TOKEN

    • A GitHub Personal Access Token with repo permissions
    • Used for checking out and committing changes to the repository
  2. OPENAI_API_KEY

    • OpenAI API key for accessing GPT-4o
    • Used for translating the README content

…tions.yml to use quotes for consistency and prevent potential parsing issues
… translation workflow to follow proper YAML structure
…ters in README content to ensure proper formatting during translation process
…ADME translation process and improve artifact handling

- Remove unnecessary steps for reading and escaping README content.
- Update the action version for translation to v1.2.0 for better performance.
- Use content_path to directly reference README.md for translation.
- Add step to upload each translated file as an artifact.
- Introduce a new commit step to handle all translated README files at once.
@0xJord4n 0xJord4n changed the base branch from main to develop December 24, 2024 13:34
@monilpat
Copy link
Collaborator

Is there a way for us to test that this works as expected? Bit worried about it missing up existing documentation? I suggest trying to do use the following to test it locally:

• Description: “act” is a command-line utility written in Go that lets you run your GitHub Actions workflows locally.
• How It Works: It parses your workflow .yml files and simulates GitHub Actions events (push, pull_request, etc.) in Docker containers on your local machine.
• Why It’s Good:

Great for quickly iterating on a workflow without having to push to a branch repeatedly.
Lets you see console output, debug logs, and environment variables as if you were running on GitHub.
• Potential Drawbacks:
Not all GitHub Actions are guaranteed to work seamlessly. Some might rely on GitHub-hosted runners or environment specifics that “act” may not perfectly replicate.
You need Docker installed locally.
• How to Get Started Quickly:
Install Docker.
Install act (on macOS you can use Homebrew: brew install act, or grab the binary from the GitHub releases page).
From your repository, run:
act <event_name>
For example, act push or act pull_request.
By default, act uses a lightweight Docker image for its runner; for more complex workflows you might need:
act <event_name> --medium or --workflows .github/workflows/<your_workflow.yml>

Copy link
Collaborator

@monilpat monilpat left a comment

Choose a reason for hiding this comment

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

Please test that this works thank you :)

@monilpat
Copy link
Collaborator

Thanks for doing this btw HUGE much appreciated :)

@0xJord4n
Copy link
Contributor Author

Hey @monilpat , I already tried many times to test it locally with act before but I've some node js runtime error that don't appear in real github actions environnement or just when running the action plugin locally with my node js:

[Generate Readme Translations/translation-5 ]   ☁  git clone 'https://github.com/actions/checkout' # ref=v4
| /run/act/actions/[email protected]/dist/index.js:53292
| class EventSourceParserStream extends TransformStream {
|                                       ^
| 
| ReferenceError: TransformStream is not defined
|     at Object.9201 (/run/act/actions/[email protected]/dist/index.js:53292:39)
|     at __nccwpck_require__ (/run/act/actions/[email protected]/dist/index.js:53384:43)
|     at Object.1746 (/run/act/actions/[email protected]/dist/index.js:10618:21)
|     at __nccwpck_require__ (/run/act/actions/[email protected]/dist/index.js:53384:43)
|     at Object.3201 (/run/act/actions/[email protected]/dist/index.js:3484:30)
|     at __nccwpck_require__ (/run/act/actions/[email protected]/dist/index.js:53384:43)
|     at Object.4279 (/run/act/actions/[email protected]/dist/index.js:184:21)
|     at __nccwpck_require__ (/run/act/actions/[email protected]/dist/index.js:53384:43)
|     at Object.1536 (/run/act/actions/[email protected]/dist/index.js:22:36)
|     at __nccwpck_require__ (/run/act/actions/[email protected]/dist/index.js:53384:43)

so here's the link of my working test on github:
https://github.com/0xJord4n/eliza/actions/runs/12481903404

merry xmas :)

@monilpat
Copy link
Collaborator

Hey @monilpat , I already tried many times to test it locally with act before but I've some node js runtime error that don't appear in real github actions environnement or just when running the action plugin locally with my node js:

[Generate Readme Translations/translation-5 ]   ☁  git clone 'https://github.com/actions/checkout' # ref=v4
| /run/act/actions/[email protected]/dist/index.js:53292
| class EventSourceParserStream extends TransformStream {
|                                       ^
| 
| ReferenceError: TransformStream is not defined
|     at Object.9201 (/run/act/actions/[email protected]/dist/index.js:53292:39)
|     at __nccwpck_require__ (/run/act/actions/[email protected]/dist/index.js:53384:43)
|     at Object.1746 (/run/act/actions/[email protected]/dist/index.js:10618:21)
|     at __nccwpck_require__ (/run/act/actions/[email protected]/dist/index.js:53384:43)
|     at Object.3201 (/run/act/actions/[email protected]/dist/index.js:3484:30)
|     at __nccwpck_require__ (/run/act/actions/[email protected]/dist/index.js:53384:43)
|     at Object.4279 (/run/act/actions/[email protected]/dist/index.js:184:21)
|     at __nccwpck_require__ (/run/act/actions/[email protected]/dist/index.js:53384:43)
|     at Object.1536 (/run/act/actions/[email protected]/dist/index.js:22:36)
|     at __nccwpck_require__ (/run/act/actions/[email protected]/dist/index.js:53384:43)

so here's the link of my working test on github: https://github.com/0xJord4n/eliza/actions/runs/12481903404

merry xmas :)

Amazing thanks for sharing the successful working test on github much appreciated

Merry Xmas :)))

@monilpat monilpat dismissed their stale review December 24, 2024 21:18

follow up comments

monilpat
monilpat previously approved these changes Dec 24, 2024
@monilpat monilpat changed the base branch from develop to main December 24, 2024 21:19
@monilpat monilpat dismissed their stale review December 24, 2024 21:19

The base branch was changed.

@monilpat monilpat changed the base branch from main to develop December 24, 2024 21:19
@monilpat
Copy link
Collaborator

For whatever reason I can't merge this PR and update the base branch do you mind git fetch -all and git pull origin/develop and pushing the latest commit as this is what I see:
Screenshot 2024-12-24 at 1 31 35 PM

@monilpat monilpat merged commit e024ef1 into elizaOS:develop Dec 24, 2024
3 checks passed
@0xJord4n
Copy link
Contributor Author

Let’s go !

have a good holiday sir :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants