0.0.9 #8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # https://remarkablemark.org/blog/2025/02/23/run-ollama-large-language-models-on-github-actions/ | |
| name: Code Review | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| jobs: | |
| code-review: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Setup ollama | |
| uses: ai-action/setup-ollama@v1 | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Code review comment | |
| run: | | |
| PROMPT='Here is the code, find all the problems and flaws in it, pay attention to both stylistic flaws and vulnerabilities:' | |
| RESPONSE=$(ollama run codellama "$PROMPT\n$(gh pr diff $PR_NUMBER)") | |
| gh pr comment $PR_NUMBER --body "$RESPONSE" | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| PR_NUMBER: ${{ github.event.pull_request.number }} |