Teams Bot GitHub Actions Run Status Card Prompt
Build a Teams bot flow that posts GitHub Actions workflow run status as Adaptive Cards — queued/running/success/failure states, job breakdown, failed-step logs, and a re-run action.
- Target user
- DevOps engineers surfacing CI/CD status in Teams
- Difficulty
- Advanced
- Tools
- Claude, ChatGPT, Cursor
The prompt
You are a senior DevOps engineer who has built GitHub Actions -> Microsoft Teams status integrations using the Bot Framework, Graph proactive messaging, and Adaptive Cards that update in place as a run progresses.
I will provide:
- Repos and workflows to track, and which branches/environments matter
- Target Teams channel(s) or chats and routing rules
- Whether re-run/approve actions from Teams are required
- Auth available (GitHub App vs PAT) and the bot's identity
- Volume (runs/hour peak) and reliability needs
Your job:
1. **Ingestion** — recommend a GitHub App with a `workflow_run` and `workflow_job` webhook. Show the signature verification step (`X-Hub-Signature-256` HMAC over the raw body) and why you must compute it before JSON parsing.
2. **State model** — map `workflow_run.status`/`conclusion` (queued, in_progress, completed + success/failure/cancelled/timed_out) to a canonical run state. Track jobs from `workflow_job` events for a step-level breakdown.
3. **Update-in-place** — this is the key UX: post one card when a run starts, then UPDATE the same message as it progresses instead of spamming. Explain the two paths:
- Bot Framework `updateActivity` using the stored `activityId` + conversation reference
- Adaptive Card Universal Action `refresh` for user-triggered refresh
Include how to persist the `activityId` keyed by `run_id`.
4. **Card design** — Adaptive Card 1.5:
- Status header with a colored badge (green success / red failure / amber running) and a spinner-like "In progress" `TextBlock`
- `FactSet`: repo, branch, actor, trigger event, duration
- A `Container` per job with a pass/fail icon; expand failed jobs via `Action.ShowCard` showing the failed step name
- `Action.OpenUrl` to the run, and `Action.Execute` "Re-run failed jobs" / "Approve deployment" (calls the GitHub REST API `POST /actions/runs/{id}/rerun-failed-jobs` or the deployment approval endpoint)
5. **Proactive messaging** — for a first post to a channel the bot must be installed; cover Graph `POST /teams/{id}/channels/{id}/messages` vs Bot Framework proactive with a stored conversation reference, and the "bot not in roster" pitfall.
6. **Reliability** — retries on transient GitHub 5xx, respecting the GitHub REST secondary rate limits, and deduping duplicate webhook deliveries by `delivery` GUID.
7. **Security of actions** — gate "Re-run"/"Approve" by mapping the Teams user (from the invoke `from.aadObjectId`) to a GitHub identity/permission before calling the API.
Output as: (a) webhook ingestion + signature verification code, (b) canonical run state machine, (c) the update-in-place activityId persistence design, (d) Adaptive Card JSON, (e) the Action.Execute handler calling the GitHub API with an authz check, (f) rate-limit and dedup handling.
Bias toward: one evolving card per run over notification spam, verified webhooks, and per-user authorization on actions.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Related prompts
-
Teams Adaptive Card Backup Job Status Digest Prompt
Design a Microsoft Teams Adaptive Card that summarizes nightly backup job outcomes — success/failure counts, failed jobs with reason, RPO breaches, and restore-test status — for the platform team.
-
Teams Adaptive Card CVE Advisory Digest Prompt
Design a daily CVE / security advisory digest posted to Microsoft Teams as an Adaptive Card — severity grouping, CVSS badges, affected-asset counts, and drill-down actions for the security team.
-
Teams Adaptive Card Kubernetes CrashLoopBackOff Alert Prompt
Design a Microsoft Teams Adaptive Card that surfaces Kubernetes CrashLoopBackOff pod alerts with restart counts, last-termination reason, container logs snippet, and one-click remediation actions.
-
Teams Adaptive Card SSL Certificate Expiry Monitor Prompt
Build a Microsoft Teams Adaptive Card digest that warns on TLS/SSL certificate expiry — days-remaining thresholds, issuer/SAN details, per-service ownership, and a renew/acknowledge action.
More Microsoft Teams prompts & error guides
Browse every Microsoft Teams prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.