From 97c0eca419035b84fadaa70b19248c6e2ecd38e1 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Tue, 27 Jan 2026 15:27:11 -0800 Subject: [PATCH] Add automated AI triage workflow for non-Blazor issues (#36692) * Initial plan * Add non-Blazor issue triage workflow with Copilot agent Co-authored-by: wadepickett <10985336+wadepickett@users.noreply.github.com> * Update .github/workflows/issue-processing-ai-triage-nonblazor.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Address PR feedback: add positive guard, pull-requests permission, and rename agent file Co-authored-by: wadepickett <10985336+wadepickett@users.noreply.github.com> * Update .github/workflows/issue-processing-ai-triage-nonblazor.yml Adding guardrex suggestions for blazor exclusion logic Co-authored-by: Luke Latham <1622880+guardrex@users.noreply.github.com> * Update .github/workflows/issue-processing-ai-triage-nonblazor.yml Co-authored-by: Luke Latham <1622880+guardrex@users.noreply.github.com> * Update issue processing workflow for non-Blazor issues Added some code commenting to make the intent clear. * Update .github/workflows/issue-processing-ai-triage-nonblazor.yml * Apply suggestion from @wadepickett Added missing space for alignment. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: wadepickett <10985336+wadepickett@users.noreply.github.com> Co-authored-by: Wade Pickett Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Luke Latham <1622880+guardrex@users.noreply.github.com> Co-authored-by: Tom Dykstra --- ...ent.md => issue-triage-nonblazor.agent.md} | 0 .../issue-processing-ai-triage-nonblazor.yml | 98 +++++++++++++++++++ 2 files changed, 98 insertions(+) rename .github/agents/{issue-triage.agent.md => issue-triage-nonblazor.agent.md} (100%) create mode 100644 .github/workflows/issue-processing-ai-triage-nonblazor.yml diff --git a/.github/agents/issue-triage.agent.md b/.github/agents/issue-triage-nonblazor.agent.md similarity index 100% rename from .github/agents/issue-triage.agent.md rename to .github/agents/issue-triage-nonblazor.agent.md diff --git a/.github/workflows/issue-processing-ai-triage-nonblazor.yml b/.github/workflows/issue-processing-ai-triage-nonblazor.yml new file mode 100644 index 000000000000..a0074b9e84fc --- /dev/null +++ b/.github/workflows/issue-processing-ai-triage-nonblazor.yml @@ -0,0 +1,98 @@ +name: Issue Triage with Copilot + +# ============================================================================= +# TRIGGER CONFIGURATION +# This workflow runs automatically when a new issue is opened in the repository +# ============================================================================= +on: + issues: + types: + - opened + +jobs: + triage-non-blazor-issue: + # =========================================================================== + # JOB FILTER CONDITION + # Only run this job for issues that: + # 1. Reference ASP.NET Core documentation (must contain aspnetcore/ path) + # 2. Are NOT related to Blazor content (excludes blazor/ folder) + # 3. Are NOT related to Blazor-adjacent content (excludes specific + # client-side interop and component tag helper docs that are + # Blazor-related but located outside the blazor/ folder) + # =========================================================================== + if: | + contains(github.event.issue.body, 'https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/') + && !contains(github.event.issue.body, 'https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/blazor') + && !contains(github.event.issue.body, 'https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/client-side/dotnet-interop/index.md') + && !contains(github.event.issue.body, 'https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/client-side/dotnet-interop/wasm-browser-app.md') + && !contains(github.event.issue.body, 'https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/client-side/dotnet-on-webworkers.md') + && !contains(github.event.issue.body, 'https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/mvc/views/tag-helpers/built-in/component-tag-helper.md') + && !contains(github.event.issue.body, 'https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/mvc/views/tag-helpers/built-in/persist-component-state.md') + runs-on: ubuntu-latest + + # =========================================================================== + # PERMISSIONS + # - issues: write - Required to post comments and add labels to issues + # - contents: read - Required to checkout the repository and read agent file + # - pull-requests: read - Required for Copilot action to access PR context that may be referred to in the issue. + # =========================================================================== + permissions: + issues: write + contents: read + pull-requests: read + steps: + # ========================================================================= + # STEP 1: POST WELCOME MESSAGE + # Immediately acknowledge the issue with a friendly welcome message + # to let the submitter know their issue has been received + # ========================================================================= + - name: Post welcome message + uses: actions/github-script@v6 + with: + script: | + await github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: `### 👋 ***Thanks for your issue!*** 😊\n\nWe will be along shortly to assist.` + }) + + # ========================================================================= + # STEP 2: CHECKOUT REPOSITORY + # Clone the repository to access the Copilot agent configuration file + # located at .github/agents/issue-triage-nonblazor.agent.md + # ========================================================================= + - name: Checkout repository + uses: actions/checkout@v4 + + # ========================================================================= + # STEP 3: RUN COPILOT AI TRIAGE + # Execute the Copilot action with the non-Blazor triage agent to: + # - Analyze the issue content + # - Generate a triage report with recommendations + # - Post the analysis as a comment on the issue + # ========================================================================= + - name: Run Copilot Issue Triage + uses: github/copilot-action@v1 + with: + agent: .github/agents/issue-triage-nonblazor.agent.md + prompt: | + Analyze issue #${{ github.event.issue.number }} and post your triage report as a comment on the issue. + Issue URL: ${{ github.event.issue.html_url }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # ========================================================================= + # STEP 4: ADD TRIAGE LABEL + # Apply the "ai-triage-action-plan" label to indicate this issue has been + # processed by the AI triage workflow and has an action plan generated + # ========================================================================= + - name: Add triage label + uses: actions/github-script@v6 + with: + script: | + await github.rest.issues.addLabels({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + labels: ["ai-triage-action-plan"] + })