diff --git a/.github/workflows/ollama-action.yml b/.github/workflows/ollama-action.yml new file mode 100644 index 00000000..24e32787 --- /dev/null +++ b/.github/workflows/ollama-action.yml @@ -0,0 +1,57 @@ +name: ollama-action + +on: + workflow_dispatch: + inputs: + model: + description: 'Ollama model name (e.g. llama3.2, tinyllama)' + required: false + default: 'llama3.2' + prompt: + description: 'Prompt to run' + required: false + default: 'Summarize recent changes in this repository.' + version: + description: 'Optional Ollama version to install (e.g. 0.15.0)' + required: false + default: '' + cache: + description: 'Whether to cache the model (true/false)' + required: false + default: 'true' + push: + branches: + - main + +permissions: + contents: read + +jobs: + run-ollama: + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - uses: actions/checkout@v4 + + - name: Run Ollama (ai-action/ollama-action) + id: ollama + uses: ai-action/ollama-action@v2 + with: + model: ${{ github.event.inputs.model || 'llama3.2' }} + prompt: ${{ github.event.inputs.prompt || 'Summarize recent changes in this repository.' }} + version: ${{ github.event.inputs.version }} + cache: ${{ github.event.inputs.cache || 'true' }} + + - name: Print Ollama response + run: | + printf '%s\n' "=== Ollama response ===" + printf '%s\n' "$response" | sed 's/^::/\x200::/' + env: + response: ${{ steps.ollama.outputs.response }} + + - name: Save response to file + run: | + mkdir -p .github + printf "%s\n" "$response" > .github/ollama-response.txt + env: + response: ${{ steps.ollama.outputs.response }} diff --git a/.gitignore b/.gitignore index 07bf113b..45b6e784 100644 --- a/.gitignore +++ b/.gitignore @@ -113,3 +113,6 @@ dev-session*.log security-test-results.json # Screenshots from browser automation *.png + +# Ollama action generated response +.github/ollama-response.txt