Files
codex-response/action.yml
T

53 lines
1.5 KiB
YAML

name: 'Composite Action Template'
description: 'Composite Action 範本'
author: 'Jeffery'
inputs:
runner_token:
description: 'Gitea Runner Token'
required: true
text:
description: '輸入的文字'
default: "Hello, World!"
outputs:
text:
description: '輸出的文字'
value: ${{ steps.display.outputs.text }}
runs:
using: 'composite'
steps:
- 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 }}
ISSUE_NUMBER: ${{ github.event.issue.number }}
RUNNER_TOKEN: ${{ secrets.RUNNER_TOKEN }}
run: |
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