Add deployment_status trigger guidance to create-agentic-workflow prompt - #18274
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
deployment_status trigger guidance to create-agentic-workflow prompt
|
@copilot no write permissions |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
| @@ -0,0 +1,60 @@ | |||
| --- | |||
There was a problem hiding this comment.
@copilot format this file as a prompt, not an agentic workflow
There was a problem hiding this comment.
Done in 4913808 — reformatted as a prompt with just description in the frontmatter. The file now follows the same pattern as report.md and github-agentic-workflows.md: reference/instructional content the agent consults when creating a deployment_status workflow, including the recommended frontmatter snippet, available event expressions, an agent instructions template, and the deployment_status vs workflow_run decision guide.
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Updates the agentic workflow creation guidance so external deployment failure monitoring uses the deployment_status trigger (instead of defaulting to workflow_run) and adds a reference prompt for deployment-status-based incident workflows.
Changes:
- Extend trigger inference guidance in
create-agentic-workflow.mdto distinguishdeployment_status(external deploy services) vsworkflow_run(in-repo pipelines). - Add
.github/aw/deployment-status.mdas a reference pattern for deployment failure monitoring and incident issue creation. - Update the dispatcher agent doc to include routing for the
test-coverageprompt.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| .github/aw/deployment-status.md | Adds a reference pattern (frontmatter + context expressions + instruction template) for deployment_status-driven incident creation. |
| .github/aw/create-agentic-workflow.md | Adds explicit trigger-selection guidance for external deployments vs internal workflow monitoring. |
| .github/agents/agentic-workflows.agent.md | Documents a new dispatcher route/use-case section for test coverage analysis workflows. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| | Expression | Description | | ||
| |---|---| | ||
| | `${{ github.event.deployment.environment }}` | Target environment (e.g. `production`) | | ||
| | `${{ github.event.deployment_status.state }}` | Status (`failure`, `success`, `error`, etc.) | | ||
| | `${{ github.event.deployment_status.target_url }}` | URL to the external service deployment logs | |
There was a problem hiding this comment.
The markdown table is using || at the start of rows, which won’t render as a table in standard Markdown. Use single | delimiters (like other docs in this repo) so the expressions/context list renders correctly.
| - Issue automation → `on: issues: types: [opened, edited]` (add `workflow_dispatch:` manually if manual runs needed) | ||
| - PR automation → `on: pull_request: types: [opened, synchronize]` (add `workflow_dispatch:` manually if manual runs needed) | ||
| - Scheduled tasks → `on: schedule: daily on weekdays` (prefer weekdays to avoid Monday backlog - workflow_dispatch auto-added for fuzzy schedules only) | ||
| - **External deployment monitoring** (Heroku, Vercel, Railway, Fly.io, etc.) → `on: deployment_status:` with `if: ${{ github.event.deployment_status.state == 'failure' }}` — use this when third-party services post deployment status back to GitHub. See reference: @.github/aw/deployment-status.md |
There was a problem hiding this comment.
This guidance filters only on github.event.deployment_status.state == 'failure', but deployment statuses may also report unsuccessful deployments as error. To avoid missing failures from external providers, consider updating the recommended condition to include both failure and error (or a non-success check).
| - **External deployment monitoring** (Heroku, Vercel, Railway, Fly.io, etc.) → `on: deployment_status:` with `if: ${{ github.event.deployment_status.state == 'failure' }}` — use this when third-party services post deployment status back to GitHub. See reference: @.github/aw/deployment-status.md | |
| - **External deployment monitoring** (Heroku, Vercel, Railway, Fly.io, etc.) → `on: deployment_status:` with `if: ${{ github.event.deployment_status.state == 'failure' || github.event.deployment_status.state == 'error' }}` — use this when third-party services post deployment status back to GitHub. See reference: @.github/aw/deployment-status.md |
| ```yaml | ||
| on: | ||
| deployment_status: | ||
| if: ${{ github.event.deployment_status.state == 'failure' }} | ||
| permissions: | ||
| contents: read | ||
| issues: read | ||
| deployments: read |
There was a problem hiding this comment.
The recommended if: filter is indented with a leading space, which makes the YAML snippet invalid if copied verbatim. Also, deployment_status.state can be error as well as failure for unsuccessful deployments, so filtering only on 'failure' can miss real deploy failures—consider matching both (failure or error) or using a broader non-success check.
The agent was defaulting to
workflow_run + if:failurefor all deployment monitoring scenarios, missingdeployment_statusas the correct trigger for external deployment services (Heroku, Vercel, Railway, Fly.io) that post status back to GitHub.Changes
.github/aw/create-agentic-workflow.md— Extended the trigger inference list with:deployment_statusentry for external deployment monitoring, with the correctif:condition and a reference to the new exampleworkflow_runentry for GitHub Actions-internal pipeline monitoringdeployment_statusfor services integrating with the GitHub Deployments API; useworkflow_runfor in-repo Actions pipelines.github/aw/deployment-status.md(new) — Reference prompt (not a runnable workflow) that the agent consults when creating a deployment monitoring workflow. Formatted likereport.mdwith onlydescriptionin the frontmatter. The body includes:deployment_statustrigger, read-only permissions, andsafe-outputsgithub.event.deployment_status.*andgithub.event.deployment.*context expressionsdeployment_statusvsworkflow_runOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.