feat: GitHub issue analysis → Teams notification workflow#339
Merged
heyitsaamir merged 12 commits intomainfrom Apr 2, 2026
Merged
feat: GitHub issue analysis → Teams notification workflow#339heyitsaamir merged 12 commits intomainfrom
heyitsaamir merged 12 commits intomainfrom
Conversation
Adds a GitHub Actions workflow that analyzes newly opened issues using the GitHub Models API (GPT-4o) and sends a rich Adaptive Card summary to a Microsoft Teams channel via proactive messaging. Supports both automatic triggers on issue open and manual dispatch with a specific issue number. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The ubuntu-latest runner's system Python is externally managed, so uv pip install --system fails. Use a venv instead. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When running from a fork, GITHUB_REPOSITORY points to the fork which has no issues. Use GITHUB_UPSTREAM_REPO to fetch from the upstream. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ContainerStyle literal is lowercase ('emphasis' not 'Emphasis').
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Simpler and avoids Pydantic validation issues with card elements. Drops microsoft-teams-cards dependency. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Send two messages to Teams: 1. Adaptive Card with triage summary (category, severity, packages) 2. Markdown message with detailed action plan (root cause, files to investigate, proposed approach, estimated complexity) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace the blind GPT-4o analysis call with GitHub Copilot CLI, which can actually read the codebase (grep, glob, read files) to produce a grounded action plan. GPT-4o is still used for the quick triage card. Flow: Copilot CLI analyzes repo → writes analysis to file → Python script reads it and sends both triage card + analysis to Teams. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Filter out the tool call lines (file reads, greps, globs) from the Copilot output so only the final analysis is sent to Teams. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Thread the Copilot analysis under the triage card by constructing
a thread conversation ID: {channelId};messageid={parentActivityId}
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Instead of having the Python script re-fetch issue data from the API, resolve all details in the workflow step (from event payload or gh API for workflow_dispatch) and pass them as environment variables. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Pass user-controlled issue data (title, body, labels) through env vars
instead of direct ${{ }} interpolation in shell to prevent injection.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
|
LGTM. Ship it. :) |
Contributor
|
I really like that we are using our sdk to triage our sdk lol :) |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an automated GitHub Issues triage + analysis pipeline that runs in GitHub Actions and posts results into Microsoft Teams, integrating GitHub Models for quick JSON triage and Copilot CLI for deeper repo-aware analysis.
Changes:
- Added a new GitHub Actions workflow to trigger on
issues: openedandworkflow_dispatch, run triage + Copilot analysis, then send notifications to Teams. - Added a Python script to call GitHub Models (GPT-4o) for structured triage, build an Adaptive Card, and send both the card and a follow-up message to Teams.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
.github/workflows/issue-analysis.yml |
Defines the end-to-end issue trigger, dependency setup, issue data extraction, Copilot CLI analysis, and script execution. |
.github/scripts/analyze_issue.py |
Implements triage via GitHub Models, Adaptive Card construction, and Teams proactive messaging. |
Use heredoc delimiters for all GITHUB_OUTPUT writes to prevent output injection from issue titles/authors containing newlines or %. Add try/except around triage JSON parsing with markdown fence extraction and a safe fallback when the model returns invalid JSON. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
workflow_dispatchfor any issue numberHow it works
Files
.github/workflows/issue-analysis.yml— workflow definition.github/scripts/analyze_issue.py— triage, card building, and Teams messagingRequired secrets
TEAMS_CLIENT_IDTEAMS_CLIENT_SECRETTEAMS_TENANT_IDTEAMS_CONVERSATION_IDCOPILOT_PATGITHUB_TOKENis automatic (provides GitHub Models API access).Test plan