|
|
||
|---|---|---|
| .forgejo/workflows | ||
| COPYING | ||
| README.md | ||
Quality Workflows
This repository contains reusable workflows to be shared across quality organization projects. They may also be of use to other projects.
ai-review.yml
This workflow will post an AI-generated review to a pull request. It can be used by adding a workflow like this to your repository:
name: AI Code Review
on:
pull_request_target:
types: [labeled]
jobs:
ai-review:
runs-on: fedora
if: forgejo.event.label.name == 'ai-review-please'
uses: quality/workflows/.forgejo/workflows/ai-review.yml@main
with:
pr: ${{ forgejo.event.pull_request.number }}
secrets:
AICR_API_KEY: ${{ secrets.AICR_API_KEY }}
You must define the AICR_API_KEY as a secret in your repository; it must be a valid API key for the configured model provider. The default model provider is Gemini. You may include a config input, like this:
...
with:
pr: ${{ forgejo.event.pull_request.number }}
config: |
include_mr_summary: false
ai_model: gemini-3.1-flash-lite-preview
...
The string is written out as .ai_review/config.yml, so it can contain any config directive ai-code-review supports. The string is written with printf, so newlines are written out as newlines in the file. You can use this to change the AI provider away from Gemini if desired.
You can use other contexts, if you like, but if so, you may need to change how the pull request number is discovered and passed through, and you may want to put remove_label: false in the with block to disable the attempt to remove the ai-review-please label after the review is done. If used as above, the workflow will post a review any time a label named ai-review-please is applied to a pull request.
Licensing
These workflows may not be copyrightable, but to the extent they are, they are licensed under the GPL, version 3 or any later version. A copy is included as COPYING.