diff --git a/README.md b/README.md index c1a7714..b37f74c 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,94 @@ utilizzabili da altri repository del workspace. ## Action disponibili +### `install-opencode` + +Installa [OpenCode](https://opencode.ai) globalmente via npm. Verifica la presenza di Node.js e npm, +installando npm automaticamente su Alpine se mancante. + +```yaml +- uses: https:////Actions/install-opencode@ + # with: + # version: "1.15.0" # fissa una versione specifica +``` + +### `opencode-prompt` + +Esegue un prompt OpenCode sul codice del repository. Richiede che `install-opencode` +sia eseguito prima, oppure che OpenCode sia giĆ  presente sul runner. + +```yaml +- id: ai + uses: https:////Actions/opencode-prompt@ + with: + prompt: "Analizza il codice e trova potenziali bug" + api-key: ${{ secrets.OPENCODE_API_KEY }} + # opzionali: + model: "deepseek/deepseek-v4-flash" # default + agent: "" # agente opencode + working-directory: "" # default: radice repo +``` + +L'output `result` contiene la risposta di OpenCode e viene salvato anche in +`$GITHUB_WORKSPACE/opencode-output.txt`. + +### `triage-issue` + +Analizza automaticamente le issue in apertura con OpenCode: classifica come **bug** o +**richiesta**, produce un riassunto, una gap analisi rispetto al codice sorgente, domande +aperte e un report tecnico dettagliato in formato Markdown caricato come asset. + +#### Utilizzo + +```yaml +- uses: https:////Actions/triage-issue@ + with: + issue-title: ${{ github.event.issue.title }} + issue-body: ${{ github.event.issue.body }} + issue-number: ${{ github.event.issue.number }} + repository: ${{ github.repository }} + api-token: ${{ secrets.TOKEN }} + api-key: ${{ secrets.OPENCODE_API_KEY }} + # opzionali: + model: "deepseek/deepseek-v4-flash" # default + gitea-host: "https://git.incloud.ovh" # default +``` + +#### Prerequisiti nel repository target + +1. **Secrets**: `TOKEN` (API Gitea), `OPENCODE_API_KEY` (API AI) +2. **Label**: `bug` (rosso `dc3545`) e `richiesta` (blu `007bff`) +3. **Workflow** (esempio `.gitea/workflows/triage.yml`): + +```yaml +name: Triage Issue +on: + issues: + types: [opened] +jobs: + triage: + runs-on: linux_amd64 + steps: + - uses: actions/checkout@v4 + - uses: https://git.incloud.ovh/anuti/Actions/install-opencode@main + - uses: https://git.incloud.ovh/anuti/Actions/triage-issue@main + with: + issue-title: ${{ github.event.issue.title }} + issue-body: ${{ github.event.issue.body }} + issue-number: ${{ github.event.issue.number }} + repository: ${{ github.repository }} + api-token: ${{ secrets.TOKEN }} + api-key: ${{ secrets.OPENCODE_API_KEY }} +``` + +#### Output + +- **Label** `bug` o `richiesta` applicata sull'issue +- **Commento** con riassunto, gap analisi e domande aperte +- **Asset Markdown** (`triage-issue-N.md`) con analisi tecnica completa, linkato nel commento + +--- + ### `version-from-tag` Estrae la versione da un tag (formato `v1.2.3.4[-suffix]`) e produce le variabili