mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
chore: Add GitHub Actions for AI-powered issue and PR management (#3886)
This commit is contained in:
parent
3648f2d54b
commit
92733e6368
5 changed files with 174 additions and 0 deletions
48
.github/workflows/models_quality.yml
vendored
Normal file
48
.github/workflows/models_quality.yml
vendored
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
name: Contribution Quality Check
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened]
|
||||
issues:
|
||||
types: [opened]
|
||||
|
||||
permissions:
|
||||
pull-requests: write
|
||||
issues: write
|
||||
models: read
|
||||
|
||||
jobs:
|
||||
quality-check:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Detect spam or low-quality content
|
||||
uses: actions/ai-inference@v1
|
||||
id: ai
|
||||
with:
|
||||
prompt: |
|
||||
Is this GitHub ${{ github.event_name == 'issues' && 'issue' || 'pull request' }} spam, AI-generated slop, or low quality?
|
||||
|
||||
Title: ${{ github.event.issue.title || github.event.pull_request.title }}
|
||||
Body: ${{ github.event.issue.body || github.event.pull_request.body }}
|
||||
|
||||
Respond with one of: spam, ai-generated, needs-review, or ok
|
||||
system-prompt: You detect spam and low-quality contributions. Be conservative - only flag obvious spam or AI slop.
|
||||
model: openai/gpt-4o-mini
|
||||
temperature: 0.1
|
||||
|
||||
- name: Apply label if needed
|
||||
if: steps.ai.outputs.response != 'ok'
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const label = `${{ steps.ai.outputs.response }}`;
|
||||
const number = ${{ github.event.issue.number || github.event.pull_request.number }};
|
||||
|
||||
if (label && label !== 'ok') {
|
||||
await github.rest.issues.addLabels({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: number,
|
||||
labels: [label]
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue