From 92733e6368a9a354c81e05115b782d25da4592f9 Mon Sep 17 00:00:00 2001 From: James Rich <2199651+jamesarich@users.noreply.github.com> Date: Tue, 2 Dec 2025 19:45:10 -0600 Subject: [PATCH] chore: Add GitHub Actions for AI-powered issue and PR management (#3886) --- .github/workflows/models_completeness.yml | 38 ++++++++++++++++++ .github/workflows/models_dedupe.yml | 26 ++++++++++++ .github/workflows/models_onboarding.yml | 22 +++++++++++ .github/workflows/models_quality.yml | 48 +++++++++++++++++++++++ .github/workflows/models_resolver.yml | 40 +++++++++++++++++++ 5 files changed, 174 insertions(+) create mode 100644 .github/workflows/models_completeness.yml create mode 100644 .github/workflows/models_dedupe.yml create mode 100644 .github/workflows/models_onboarding.yml create mode 100644 .github/workflows/models_quality.yml create mode 100644 .github/workflows/models_resolver.yml diff --git a/.github/workflows/models_completeness.yml b/.github/workflows/models_completeness.yml new file mode 100644 index 000000000..0282aa931 --- /dev/null +++ b/.github/workflows/models_completeness.yml @@ -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 }}` + }) \ No newline at end of file diff --git a/.github/workflows/models_dedupe.yml b/.github/workflows/models_dedupe.yml new file mode 100644 index 000000000..a25728f1b --- /dev/null +++ b/.github/workflows/models_dedupe.yml @@ -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 \ No newline at end of file diff --git a/.github/workflows/models_onboarding.yml b/.github/workflows/models_onboarding.yml new file mode 100644 index 000000000..b700f81eb --- /dev/null +++ b/.github/workflows/models_onboarding.yml @@ -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 }} \ No newline at end of file diff --git a/.github/workflows/models_quality.yml b/.github/workflows/models_quality.yml new file mode 100644 index 000000000..4be26c6a6 --- /dev/null +++ b/.github/workflows/models_quality.yml @@ -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] + }); + } diff --git a/.github/workflows/models_resolver.yml b/.github/workflows/models_resolver.yml new file mode 100644 index 000000000..fa97c5ae3 --- /dev/null +++ b/.github/workflows/models_resolver.yml @@ -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 + }); \ No newline at end of file