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
38
.github/workflows/models_completeness.yml
vendored
Normal file
38
.github/workflows/models_completeness.yml
vendored
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
name: Issue Completeness Check
|
||||
|
||||
on:
|
||||
issues:
|
||||
types: [opened]
|
||||
|
||||
permissions:
|
||||
issues: write
|
||||
models: read
|
||||
|
||||
jobs:
|
||||
check-completeness:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check issue completeness
|
||||
uses: actions/ai-inference@v1
|
||||
id: ai
|
||||
with:
|
||||
prompt: |
|
||||
Analyze this GitHub issue for completeness. If missing reproduction steps, version info, or expected/actual behavior, respond with a friendly request for the missing info. If complete, say so.
|
||||
|
||||
Title: ${{ github.event.issue.title }}
|
||||
Body: ${{ github.event.issue.body }}
|
||||
system-prompt: You are a helpful assistant that helps analyze GitHub issues for completeness.
|
||||
model: openai/gpt-4o-mini
|
||||
temperature: 0.2
|
||||
|
||||
- name: Comment on issue
|
||||
if: steps.ai.outputs.response != ''
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
github.rest.issues.createComment({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: ${{ github.event.issue.number }},
|
||||
body: `${{ steps.ai.outputs.response }}`
|
||||
})
|
||||
26
.github/workflows/models_dedupe.yml
vendored
Normal file
26
.github/workflows/models_dedupe.yml
vendored
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
name: Detect duplicate issues
|
||||
|
||||
on:
|
||||
issues:
|
||||
types: [opened, reopened]
|
||||
|
||||
permissions:
|
||||
models: read
|
||||
issues: write
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.issue.number }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
continuous-triage-dedup:
|
||||
if: ${{ github.event.issue.user.type != 'Bot' }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: pelikhan/action-genai-issue-dedup@v0
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
# Optional tuning:
|
||||
# labels: "auto" # compare within matching labels, or "bug,api"
|
||||
# count: "20" # how many recent issues to check
|
||||
# since: "90d" # look back window, supports d/w/m
|
||||
22
.github/workflows/models_onboarding.yml
vendored
Normal file
22
.github/workflows/models_onboarding.yml
vendored
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
name: Continuous AI Resolver
|
||||
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0 * * 0' # Runs every Sunday at midnight UTC
|
||||
workflow_dispatch:
|
||||
|
||||
|
||||
permissions:
|
||||
issues: write
|
||||
pull-requests: write
|
||||
|
||||
|
||||
jobs:
|
||||
resolver:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Run resolver
|
||||
uses: ashleywolf/continuous-ai-resolver@main
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
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]
|
||||
});
|
||||
}
|
||||
40
.github/workflows/models_resolver.yml
vendored
Normal file
40
.github/workflows/models_resolver.yml
vendored
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
name: Welcome New Contributors
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened]
|
||||
|
||||
permissions:
|
||||
pull-requests: write
|
||||
models: read
|
||||
|
||||
jobs:
|
||||
welcome:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'
|
||||
steps:
|
||||
- name: Generate welcome message
|
||||
uses: actions/ai-inference@v1
|
||||
id: ai
|
||||
with:
|
||||
prompt: |
|
||||
Write a friendly welcome message for a first-time contributor. Include:
|
||||
1. Thank them for their first PR
|
||||
2. Mention checking CONTRIBUTING.md
|
||||
3. Offer to help if they have questions
|
||||
|
||||
Keep it brief and encouraging.
|
||||
model: openai/gpt-4o-mini
|
||||
temperature: 0.7
|
||||
|
||||
- name: Post welcome comment
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const message = `${{ steps.ai.outputs.response }}`;
|
||||
await github.rest.issues.createComment({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: ${{ github.event.pull_request.number }},
|
||||
body: message
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue