Files
shockbot/.gitea/workflows/shockbot.yml
T

46 lines
1.3 KiB
YAML

name: Shockbot
on:
pull_request:
types: [opened, synchronize, ready_for_review]
issue_comment:
types: [created]
permissions:
contents: write
pull-requests: write
issues: write
jobs:
review:
if: |
(github.event_name == 'pull_request' && !github.event.pull_request.draft) ||
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@shockbot'))
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Run shockbot (PR trigger)
if: github.event_name == 'pull_request'
uses: ./
with:
prompt: "Review PR #${{ github.event.pull_request.number }}: ${{ github.event.pull_request.title }}"
env:
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
OLLAMA_HOST: ${{ secrets.OLLAMA_HOST }}
GITEA_URL: https://git.shockvpn.com
GITHUB_REPOSITORY: ${{ github.repository }}
- name: Run shockbot (mention trigger)
if: github.event_name == 'issue_comment'
uses: ./
with:
prompt: ${{ github.event.comment.body }}
env:
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
OLLAMA_HOST: ${{ secrets.OLLAMA_HOST }}
GITEA_URL: https://git.shockvpn.com
GITHUB_REPOSITORY: ${{ github.repository }}