From d5e91d5d589e177361a67b37e2e1861f0e103b77 Mon Sep 17 00:00:00 2001 From: yp05327 <576951401@qq.com> Date: Sun, 12 Oct 2025 07:01:10 +0000 Subject: [PATCH 1/3] test --- .codex/prompts/readme-translation.txt | 8 ++++++++ .github/workflows/files-changed.yml | 6 ++++++ .github/workflows/pull-compliance.yml | 12 ++++++++++++ README.md | 2 ++ 4 files changed, 28 insertions(+) create mode 100644 .codex/prompts/readme-translation.txt diff --git a/.codex/prompts/readme-translation.txt b/.codex/prompts/readme-translation.txt new file mode 100644 index 0000000000000..06f8041092c7a --- /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: +- Clone the repository from https://github.com/go-gitea/gitea and create a new branch for your work +- 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 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..a4a348adb0284 100644 --- a/.github/workflows/pull-compliance.yml +++ b/.github/workflows/pull-compliance.yml @@ -195,3 +195,15 @@ 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 + - run: | + npm install -g @openai/codex + codex exec --full-auto -c model="gpt-5-codex" -c model_providers.openai.base_url="${{ secrets.OPENAI_BASE_URL }}" -c model_providers.openai.env_key="OPENAI_API_KEY" "$(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 From 992e7f43b4e5216a3f2285280a041ecaad825f5f Mon Sep 17 00:00:00 2001 From: yp05327 <576951401@qq.com> Date: Sun, 12 Oct 2025 07:48:58 +0000 Subject: [PATCH 2/3] fix --- .codex/prompts/readme-translation.txt | 2 +- .github/workflows/pull-compliance.yml | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.codex/prompts/readme-translation.txt b/.codex/prompts/readme-translation.txt index 06f8041092c7a..dc76b27f619e5 100644 --- a/.codex/prompts/readme-translation.txt +++ b/.codex/prompts/readme-translation.txt @@ -2,7 +2,7 @@ Your task is translate `README.md` into several languages. The translation shoul 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: -- Clone the repository from https://github.com/go-gitea/gitea and create a new branch for your work - 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/pull-compliance.yml b/.github/workflows/pull-compliance.yml index a4a348adb0284..dc0b33f7e3c60 100644 --- a/.github/workflows/pull-compliance.yml +++ b/.github/workflows/pull-compliance.yml @@ -201,9 +201,18 @@ jobs: needs: files-changed runs-on: ubuntu-latest env: - OPENAI_API_KEY : ${{ secrets.OPENAI_API_KEY }} + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} steps: - uses: actions/checkout@v4 - - run: | + - 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_providers.openai.base_url="${{ secrets.OPENAI_BASE_URL }}" -c model_providers.openai.env_key="OPENAI_API_KEY" "$(cat ./.codex/prompts/readme-translation.txt)" + 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)" From 4f9faab326b3d68c7697eda9d3d159589cc568ad Mon Sep 17 00:00:00 2001 From: yp05327 <576951401@qq.com> Date: Sun, 12 Oct 2025 07:55:59 +0000 Subject: [PATCH 3/3] test --- .github/workflows/pull-compliance.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pull-compliance.yml b/.github/workflows/pull-compliance.yml index dc0b33f7e3c60..993c87b7b19b4 100644 --- a/.github/workflows/pull-compliance.yml +++ b/.github/workflows/pull-compliance.yml @@ -216,3 +216,4 @@ jobs: -c model_providers.gitea_openai.env_key="OPENAI_API_KEY" \ -c model_providers.gitea_openai.wire_api="responses" \ "$(cat ./.codex/prompts/readme-translation.txt)" +