Generate, modify, and troubleshoot CI/CD pipelines with Copilot. From workflow YAML to infrastructure as code.
Copilot understands Actions syntax. Example prompts for common tasks.
| Task | Example Prompt |
|---|---|
| Add CI pipeline | Create a GitHub Actions workflow that builds and tests on every PR to main |
| Add security scanning | Add a CodeQL security scan step to our CI pipeline, running on every PR |
| Add deployment | Add a deployment step to staging on merge to main, with manual approval for production |
| Matrix builds | Update CI to test against Node 18, 20, and 22 on Ubuntu and Windows |
When a workflow fails, Copilot can diagnose and fix it:
Example:
Common patterns to ask Copilot to generate:
Use `/explain` on existing workflow files before modifying them. Complex YAML with matrix strategies, conditions, and secrets can be hard to parse โ let Copilot explain it first.
Copilot generates infrastructure definitions across providers.
| Provider | Format | Example Prompt |
|---|---|---|
| Azure | Bicep / ARM | Generate a Bicep template for an Azure App Service with managed identity, connected to Key Vault |
| AWS | CloudFormation / CDK | Create a CloudFormation template for an S3 bucket with versioning and lifecycle policy |
| Multi-cloud | Terraform | Generate a Terraform module for a PostgreSQL database with read replicas and SSL |
| Kubernetes | YAML manifests | Create a K8s deployment with 3 replicas, health checks, resource limits, and HPA |
Example:
Advanced: Create custom `.agent.md` files for CI-specific review. Example: "Review all changes to .github/workflows/ for: exposed secrets, missing permission scoping, use of deprecated actions, and missing concurrency controls." This catches pipeline misconfigurations before they reach main.