TechSummary 2025-08-28
· 閱讀時間約 15 分鐘
🤖 GitHub Models 如何幫助開源維護者專注於核心工作
- 開源專案維護者常因重複性管理工作(如分類問題、處理重複項、要求重現步驟)而分心,GitHub Models 旨在利用 AI 自動化這些重複性工作。
- 透過 GitHub Models 結合 GitHub Actions,實現「持續 AI」(Continuous AI) 模式,提供自動化工作流程,例如自動問題去重、問題完整性檢查、垃圾郵件與低品質貢獻偵測、持續解決方案以及新貢獻者引導。
- 自動問題去重範例:
name: Detect duplicate issues
on:
issues:
types: [opened, reopened]
permissions:
models: read
issues: write
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 - 問題完整性檢查範例:
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 }}`
}) - 建議維護者從一個工作流程開始,逐步擴展,並監控結果、根據專案語氣調整 AI 提示。