Update .gitea/workflows/opencode.yml
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 3s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 3s
This commit is contained in:
@@ -3,6 +3,8 @@ name: OpenCode Gitea Integration
|
|||||||
on:
|
on:
|
||||||
issue_comment:
|
issue_comment:
|
||||||
types: [created]
|
types: [created]
|
||||||
|
dispatch:
|
||||||
|
types: [workflow_dispatch]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
opencode-gitea:
|
opencode-gitea:
|
||||||
@@ -10,24 +12,40 @@ jobs:
|
|||||||
contains(github.event.comment.body, '/oc') ||
|
contains(github.event.comment.body, '/oc') ||
|
||||||
contains(github.event.comment.body, '/opencode')
|
contains(github.event.comment.body, '/opencode')
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 20
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 1
|
fetch-depth: 1
|
||||||
persist-credentials: false
|
|
||||||
|
|
||||||
- name: Esegui OpenCode
|
- name: Install OpenCode CLI
|
||||||
uses: anomalyco/opencode/github@latest
|
run: |
|
||||||
|
curl -fsSL https://opencode.ai/install | bash
|
||||||
|
echo "$HOME/.opencode/bin" >> $GITHUB_PATH
|
||||||
|
|
||||||
|
- name: Execute OpenCode (Big Pickle)
|
||||||
env:
|
env:
|
||||||
# Inserisci nei Secret di Gitea la chiave ottenuta dalla dashboard di OpenCode Zen
|
# OpenCode Zen Configuration
|
||||||
OPENCODE_ZEN_API_KEY: ${{ secrets.OPENCODE_ZEN_API_KEY }}
|
OPENCODE_ZEN_API_KEY: ${{ secrets.OPENCODE_ZEN_API_KEY }}
|
||||||
# Specifichiamo l'endpoint di OpenCode Zen per l'esecuzione remota dell'agente
|
|
||||||
OPENCODE_API_BASE: https://opencode.ai/zen/v1
|
OPENCODE_API_BASE: https://opencode.ai/zen/v1
|
||||||
# Passiamo il token di Gitea per permettere l'autenticazione sulla piattaforma
|
OPENCODE_MODEL: opencode/big-pickle
|
||||||
|
|
||||||
|
GITHUB_API_URL: "https://maribit.it"
|
||||||
GITHUB_TOKEN: ${{ secrets.BOT_GITEA_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.BOT_GITEA_TOKEN }}
|
||||||
with:
|
|
||||||
# Configura l'azione per invocare Big Pickle
|
# Passiamo il contesto della issue corretto recuperato da Gitea
|
||||||
model: opencode/big-pickle
|
ISSUE_NUMBER: ${{ github.event.issue.number }}
|
||||||
use_github_token: true
|
COMMENT_BODY: ${{ github.event.comment.body }}
|
||||||
|
REPO_NAME: ${{ github.repository }}
|
||||||
|
run: |
|
||||||
|
# Configuriamo git nel runner per evitare blocchi sui permessi locali
|
||||||
|
git config --global user.name "OpenCode Bot"
|
||||||
|
git config --global user.email "opencode-bot@maribit.it"
|
||||||
|
|
||||||
|
# Eseguiamo direttamente l'agente via CLI saltando i controlli bloccanti di GitHub
|
||||||
|
opencode github run \
|
||||||
|
--token "$GITHUB_TOKEN" \
|
||||||
|
--model "$OPENCODE_MODEL" \
|
||||||
|
--url "$GITHUB_API_URL"
|
||||||
|
|||||||
Reference in New Issue
Block a user