From f0c56a0616907f48aea4b13e7e0527af78a7efc6 Mon Sep 17 00:00:00 2001 From: Jeffery Date: Wed, 24 Jun 2026 15:31:19 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=BB=BA=E7=AB=8B=E4=B8=BB=E8=A6=81?= =?UTF-8?q?=E8=99=95=E7=90=86=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- action.yml | 40 +++++++++++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 9 deletions(-) diff --git a/action.yml b/action.yml index 028357c..b9358ab 100644 --- a/action.yml +++ b/action.yml @@ -15,17 +15,39 @@ outputs: runs: using: 'composite' steps: - - name: 顯示資訊 - id: display + - name: 取得專案 + uses: actions/checkout@v6 + - name: 產生 AI 回覆 + id: response + uses: https://gitea.jsc.idv.tw/actions/codex@v0.0.2 + with: + OAUTH: ${{ secrets.CODEX_OAUTH }} + MODEL: gpt-5.4-mini + PROMPT: | + 請根據以下 Gitea issue 資訊,以繁體中文回覆使用者。 + 請只輸出要張貼到 issue 留言中的內容,不要包含額外前言。 + + ## 問題標題 + ${{ github.event.issue.title }} + + ## 問題描述 + ${{ github.event.issue.body }} + + ## 使用者留言 + ${{ github.event.comment.body }} + - name: 留言 AI 回覆 env: GITEA_SERVER_URL: ${{ gitea.server_url }} GITEA_REPOSITORY: ${{ gitea.repository }} - RUNNER_TOKEN: ${{ inputs.runner_token }} - TEXT: ${{ inputs.text }} + ISSUE_NUMBER: ${{ github.event.issue.number }} + RUNNER_TOKEN: ${{ secrets.RUNNER_TOKEN }} run: | - echo "Gitea Server Url: $GITEA_SERVER_URL" - echo "Gitea Repository: $GITEA_REPOSITORY" - echo "Gitea Runner Token: $RUNNER_TOKEN" - echo "Input Text: $TEXT" - echo "text=$TEXT" >> "$GITHUB_OUTPUT" + jq -n --rawfile body response.md '{body: $body}' > comment.json + + curl --fail-with-body \ + -X POST \ + -H "Authorization: token $RUNNER_TOKEN" \ + -H "Content-Type: application/json" \ + --data @comment.json \ + "$GITEA_SERVER_URL/api/v1/repos/$GITEA_REPOSITORY/issues/$ISSUE_NUMBER/comments" shell: bash \ No newline at end of file