diff --git a/.codex/prompts/readme-translation.txt b/.codex/prompts/readme-translation.txt new file mode 100644 index 0000000000000..dc76b27f619e5 --- /dev/null +++ b/.codex/prompts/readme-translation.txt @@ -0,0 +1,8 @@ +Your task is translate `README.md` into several languages. The translation should sound natural and easy to read. +Target languages: Chinese (zh-cn), Chinese (zh-tw), Japanese (ja-JP) +Use the following format for each translation: `README.{language_code}-{country_code}.md` +Rules: +- If a translation file already exists, only update the changes +- If a translation file does not exist, create a new one and add the link in `README.md` and each translated readme file +- Do not modify the original `README.md` file +- git commit to current branch and push to remote diff --git a/.github/workflows/files-changed.yml b/.github/workflows/files-changed.yml index edceef0092bd2..22cdf72a993e7 100644 --- a/.github/workflows/files-changed.yml +++ b/.github/workflows/files-changed.yml @@ -19,6 +19,8 @@ on: value: ${{ jobs.detect.outputs.swagger }} yaml: value: ${{ jobs.detect.outputs.yaml }} + readme: + value: ${{ jobs.detect.outputs.readme }} jobs: detect: @@ -33,6 +35,7 @@ jobs: docker: ${{ steps.changes.outputs.docker }} swagger: ${{ steps.changes.outputs.swagger }} yaml: ${{ steps.changes.outputs.yaml }} + readme: ${{ steps.changes.outputs.readme }} steps: - uses: actions/checkout@v4 - uses: dorny/paths-filter@v3 @@ -98,3 +101,6 @@ jobs: - "**/*.yaml" - ".yamllint.yaml" - "pyproject.toml" + + readme: + - "README.md" diff --git a/.github/workflows/pull-compliance.yml b/.github/workflows/pull-compliance.yml index 6f8991ed4ee61..993c87b7b19b4 100644 --- a/.github/workflows/pull-compliance.yml +++ b/.github/workflows/pull-compliance.yml @@ -195,3 +195,25 @@ jobs: go-version-file: go.mod check-latest: true - run: make lint-actions + + readme: + if: needs.files-changed.outputs.readme == 'true' + needs: files-changed + runs-on: ubuntu-latest + env: + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + steps: + - uses: actions/checkout@v4 + - name: translate-readme + if: steps.openai-secret.outputs.skip != 'true' + run: | + npm install -g @openai/codex + codex exec --full-auto \ + -c model="gpt-5-codex" \ + -c model_provider="gitea_openai" \ + -c model_providers.gitea_openai.name="gitea_openai" \ + -c model_providers.gitea_openai.base_url="${{ secrets.OPENAI_BASE_URL }}" \ + -c model_providers.gitea_openai.env_key="OPENAI_API_KEY" \ + -c model_providers.gitea_openai.wire_api="responses" \ + "$(cat ./.codex/prompts/readme-translation.txt)" + diff --git a/README.md b/README.md index ed000971a7555..f615ae05cc968 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,8 @@ [![Contribute with Gitpod](https://img.shields.io/badge/Contribute%20with-Gitpod-908a85?logo=gitpod&color=green)](https://gitpod.io/#https://github.com/go-gitea/gitea) [![](https://badges.crowdin.net/gitea/localized.svg)](https://translate.gitea.com "Crowdin") +this line is added for test + [繁體中文](./README.zh-tw.md) | [简体中文](./README.zh-cn.md) ## Purpose