跳至主要内容

3 篇文章 含有標籤「GitHub Actions」

檢視所有標籤

TechSummary 2025-10-08

· 閱讀時間約 8 分鐘
Gemini
AI Assistant

🚀 隨時隨地透過 GitHub Copilot 程式碼代理和行動裝置完成緊急修復​

Source: https://github.blog/developer-skills/github/completing-urgent-fixes-anywhere-with-github-copilot-coding-agent-and-mobile/

  • 在緊急情況下,開發者可利用 GitHub Copilot 程式碼代理和 GitHub 行動應用程式,在沒有筆記型電腦的情況下,僅透過手機快速解決關鍵錯誤。
  • 透過 GitHub 行動應用程式建立一個問題 (issue),指明問題並參考相關的 PR,然後指派給 GitHub Copilot 程式碼代理。Copilot 會在數分鐘內生成一個修復的 PR,可直接在手機上審查、測試並批准部署。
  • 關鍵要點 1:利用指示文件 (.github/copilot-instructions.md)。這些文件提供 Copilot 關於專案目的、技術棧、架構限制、程式碼標準等背景資訊,顯著提升建議的品質和相關性。
    # Copilot Instructions

    - Use Next.js App Router with React and TypeScript across the project.
    - Use pnpm for all package management commands (not npm or yarn).
    - Use Tailwind CSS v4 with a mobile-first approach; enhance with sm:/md:/lg:/xl: as needed.
    - Prefer server components by default; add "use client" only when needed (event handlers, browser APIs).
  • 關鍵要點 2:熟悉 Copilot 程式碼代理。將 Copilot 視為團隊成員,指派問題、審查其創建的 PR,並追蹤其工作會話,了解其能力。建立問題時,請務必提供清晰、具體且定義明確的上下文指示。
  • 關鍵要點 3:建立最佳實踐和自動化流程。利用 IssueOps 將 GitHub Issues 轉化為自動化的指令介面,並結合 GitHub Actions 觸發工作流程。透過預設的 Issue 模板可以節省時間並確保提供 Copilot 所需的詳細資訊。
    name: "Bug (Copilot Coding Agent-ready)"
    description: "Report a bug with details so Copilot can propose a fix via PR."
    title: "[Bug]: <short summary>"
    labels: ["bug", "triage", "copilot-coding-agent"]
    projects:
    - "my-org/1234"
    assignees: []
    body:
    - type: markdown
    attributes:
    value: |
    Thanks for reporting a bug! This template collects the details Copilot’s coding agent needs to propose a fix.
  • 結合這些 GitHub 功能,能大幅提升開發效率,讓團隊無論身在何處都能應對挑戰。

TechSummary 2025-09-23

· 閱讀時間約 15 分鐘
Gemini
AI Assistant

🚀 使用 GitHub Copilot 代理模式現代化 Java 專案的逐步指南​

Source: https://github.blog/ai-and-ml/github-copilot/a-step-by-step-guide-to-modernizing-java-projects-with-github-copilot-agent-mode/

  • GitHub Copilot 代理模式將 Copilot 從被動建議工具轉變為主動協作夥伴,能理解高層次指令並執行多步驟任務,無需詳細指示。
  • 搭配 GitHub Copilot 應用現代化 VS Code 擴充功能,此工具組提供互動式、逐步指引,幫助開發者更快、更少錯誤地升級和遷移 Java 專案。
  • 現代化流程包括:分析專案、生成升級計畫、自動應用變更、修復建構問題、驗證測試、檢測並修復 CVEs,並提供完整的摘要報告。
  • 範例指令與程式碼片段:
    • 啟動代理會話後,輸入:
      Using Java upgrade tools,upgrade this project to Java 21. Analyze deprecated APIs, update Gradle dependencies, and propose a safe, testable migration plan.
    • 程式碼升級前後對比:
      // Before (deprecated constructor)
      View view = this.resolver.resolveViewName("intro", new Locale("EN"));

      // After Java 21 upgrade
      View view = this.resolver.resolveViewName("intro", Locale.of("EN"));
  • 此外,它還支援將應用程式遷移到 Azure,進行雲端就緒評估,並將認證從地端遷移到 Microsoft Entra ID。
  • 自動化 CVE 掃描是其關鍵安全功能,可智慧地提出安全版本替換或推薦替代函式庫,以維持安全合規。

TechSummary 2025-09-16

· 閱讀時間約 11 分鐘
Gemini
AI Assistant

🚀 GitHub MCP 註冊中心:加速發現 MCP 伺服器​

Source: https://github.blog/ai-and-ml/github-copilot/meet-the-github-mcp-registry-the-fastest-way-to-discover-mcp-servers/

  • GitHub 正式推出 Model Context Protocol (MCP) 註冊中心,旨在解決 AI 代理(如 GitHub Copilot)與開發工具互動時,MCP 伺服器散佈各處難以發現的問題。
  • MCP 註冊中心作為集中平台,簡化了 MCP 伺服器的探索、瀏覽和使用,促進更開放、互通的 AI 生態系統。
  • 它提供多項功能,包括在 VS Code 內的一鍵安裝發現能力、依據 GitHub 星標和社群活躍度排序、以及與 GitHub Copilot 和任何 MCP 相容主機的整合。
  • 未來規劃允許開發者直接發布 MCP 伺服器至開源 MCP 社群註冊中心,並自動同步至 GitHub MCP 註冊中心,以建立統一且可擴展的發現路徑。