mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-01-29 09:52:27 -05:00
50 lines
1.7 KiB
YAML
50 lines
1.7 KiB
YAML
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
|
|
if: ${{ github.event_name == 'issues' || (github.event_name == 'pull_request' && github.event.pull_request.labels == null || !contains(join(github.event.pull_request.labels.*.name, ','), 'automation')) }}
|
|
steps:
|
|
- name: Detect spam or low-quality content
|
|
uses: actions/ai-inference@v2
|
|
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@v8
|
|
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]
|
|
});
|
|
}
|