Files
test/.gitea/workflows/opencode.yml
T
maria 5557700eca
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 3s
Update .gitea/workflows/opencode.yml
2026-07-05 15:54:06 +00:00

52 lines
1.6 KiB
YAML

name: OpenCode Gitea Integration
on:
issue_comment:
types: [created]
dispatch:
types: [workflow_dispatch]
jobs:
opencode-gitea:
if: |
contains(github.event.comment.body, '/oc') ||
contains(github.event.comment.body, '/opencode')
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Install OpenCode CLI
run: |
curl -fsSL https://opencode.ai/install | bash
echo "$HOME/.opencode/bin" >> $GITHUB_PATH
- name: Execute OpenCode (Big Pickle)
env:
# OpenCode Zen Configuration
OPENCODE_ZEN_API_KEY: ${{ secrets.OPENCODE_ZEN_API_KEY }}
OPENCODE_API_BASE: https://opencode.ai/zen/v1
OPENCODE_MODEL: opencode/big-pickle
GITHUB_API_URL: "https://maribit.it"
GITHUB_TOKEN: ${{ secrets.BOT_GITEA_TOKEN }}
# Passiamo il contesto della issue corretto recuperato da Gitea
ISSUE_NUMBER: ${{ github.event.issue.number }}
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"