feat(codex-response): 整合 Codex issue 回覆 action #2
+31
-9
@@ -15,17 +15,39 @@ outputs:
|
|||||||
runs:
|
runs:
|
||||||
using: 'composite'
|
using: 'composite'
|
||||||
steps:
|
steps:
|
||||||
- name: 顯示資訊
|
- name: 取得專案
|
||||||
id: display
|
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:
|
env:
|
||||||
GITEA_SERVER_URL: ${{ gitea.server_url }}
|
GITEA_SERVER_URL: ${{ gitea.server_url }}
|
||||||
GITEA_REPOSITORY: ${{ gitea.repository }}
|
GITEA_REPOSITORY: ${{ gitea.repository }}
|
||||||
RUNNER_TOKEN: ${{ inputs.runner_token }}
|
ISSUE_NUMBER: ${{ github.event.issue.number }}
|
||||||
TEXT: ${{ inputs.text }}
|
RUNNER_TOKEN: ${{ secrets.RUNNER_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
echo "Gitea Server Url: $GITEA_SERVER_URL"
|
jq -n --rawfile body response.md '{body: $body}' > comment.json
|
||||||
echo "Gitea Repository: $GITEA_REPOSITORY"
|
|
||||||
echo "Gitea Runner Token: $RUNNER_TOKEN"
|
curl --fail-with-body \
|
||||||
echo "Input Text: $TEXT"
|
-X POST \
|
||||||
echo "text=$TEXT" >> "$GITHUB_OUTPUT"
|
-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
|
shell: bash
|
||||||
Reference in New Issue
Block a user