Skip to content

Commit 94bfa41

Browse files
docs: update documentation for features merged 2026-04-27 (#28697)
1 parent 9d36179 commit 94bfa41

2 files changed

Lines changed: 149 additions & 3 deletions

File tree

docs/src/content/docs/reference/playwright.md

Lines changed: 55 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,36 +105,88 @@ Create an issue for each category of problems found.
105105

106106
### Visual Regression Testing
107107

108+
Pin to a specific version and use `steps:` to start the application before the agent runs. This is the recommended pattern when testing a local dev server.
109+
108110
```aw wrap
109111
---
110112
on:
111113
pull_request:
112114
types: [opened, synchronize]
115+
paths:
116+
- 'docs/src/**/*.css'
117+
- 'docs/src/**/*.tsx'
118+
- 'docs/src/**/*.astro'
119+
- 'docs/astro.config.mjs'
120+
121+
steps:
122+
- name: Checkout repository
123+
uses: actions/checkout@v6
124+
with:
125+
persist-credentials: false
126+
- name: Install dependencies
127+
working-directory: ./docs
128+
run: npm ci
129+
- name: Build documentation
130+
working-directory: ./docs
131+
run: npm run build
132+
- name: Start dev server
133+
working-directory: ./docs
134+
run: npm run dev &
135+
- name: Wait for dev server
136+
run: |
137+
for i in $(seq 1 30); do
138+
if curl -sf http://localhost:4321/ > /dev/null 2>&1; then
139+
echo "Dev server is ready"; exit 0
140+
fi
141+
sleep 1
142+
done
143+
exit 1
113144
114145
tools:
115146
playwright:
147+
version: "v1.52.0"
148+
bash:
149+
- "npm *"
150+
- "curl http://localhost:*"
116151
117152
network:
118153
allowed:
119154
- defaults
120155
- playwright
121-
- github
156+
- local
157+
- node
122158
123159
permissions:
124160
contents: read
125161
126162
safe-outputs:
127163
add-comment:
128164
max: 1
165+
noop:
129166
---
130167
131168
# Visual Regression Check
132169
133-
Compare screenshots of the documentation site before and after this PR.
170+
The documentation site dev server is running at http://localhost:4321/.
171+
172+
Check for visual regressions on these pages: home, getting-started, and reference.
173+
174+
Test on multiple viewports:
175+
- Mobile: 375×812
176+
- Tablet: 768×1024
177+
- Desktop: 1440×900
134178
135-
Test on multiple viewports (mobile, tablet, desktop) and report any visual differences.
179+
Take screenshots at each viewport and compare against baseline. Report any visual differences as a pull request comment, including screenshots. If there are no regressions, call noop.
136180
```
137181

182+
**Key patterns for dev server visual regression:**
183+
184+
- **Path filter** — restricts the trigger to runs affecting frontend assets, avoiding noise on unrelated changes.
185+
- **`steps:`** — run before the agent. Use them to install dependencies, build, start the server, and poll until it is ready. The agent only starts after all steps succeed.
186+
- **Version pin** — pin Playwright to a specific version (`v1.52.0`) to prevent baseline drift from browser engine upgrades mid-test.
187+
- **`local` network identifier** — allows the Playwright container to reach `localhost`/`127.0.0.1` where the dev server runs. Required when testing local servers.
188+
- **`bash` allowlist** — restricts the `bash` tool to `npm *` and `curl http://localhost:*` only, keeping the tool surface minimal.
189+
138190
### End-to-End Testing
139191

140192
```aw wrap

docs/src/content/docs/reference/triggers.md

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,97 @@ Workflows with `workflow_run` triggers include automatic security protections:
279279

280280
See the [Security Architecture](/gh-aw/introduction/architecture/) for details.
281281

282+
### Deployment Status Triggers (`deployment_status:`)
283+
284+
Trigger workflows when a GitHub deployment status changes. [Full event reference](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#deployment_status).
285+
286+
```yaml wrap
287+
on:
288+
deployment_status:
289+
```
290+
291+
#### State Filtering (`state:`)
292+
293+
Use `state:` to restrict the trigger to specific deployment states. The compiler compiles this into a guarded `if:` condition so the workflow only runs for the matching states. Other combined triggers (such as `workflow_dispatch`) are not blocked by the guard.
294+
295+
```yaml wrap
296+
on:
297+
deployment_status:
298+
state: failure # Single state
299+
```
300+
301+
```yaml wrap
302+
on:
303+
deployment_status:
304+
state: [error, failure] # Multiple states
305+
workflow_dispatch: # Safely combined — guard ensures dispatch passes through
306+
```
307+
308+
Valid `state` values: `error`, `failure`, `pending`, `success`, `inactive`, `in_progress`, `queued`, `waiting`.
309+
310+
> [!NOTE]
311+
> The `state` field compiles into a GitHub Actions `if:` condition: `github.event_name != 'deployment_status' || (github.event.deployment_status.state == 'failure')`. This means the workflow still runs when triggered by other events in the same `on:` block.
312+
313+
#### Required Permissions
314+
315+
Workflows triggered by `deployment_status` need `deployments: read` to access the event payload:
316+
317+
```yaml wrap
318+
permissions:
319+
contents: read
320+
deployments: read
321+
```
322+
323+
#### Natural Language Shorthands
324+
325+
```yaml wrap
326+
on: "deployment failed" # deployment_status with state == 'failure'
327+
on: "deployment error" # deployment_status with state == 'error'
328+
on: "deployment failed or error" # deployment_status with state == 'failure' or 'error'
329+
```
330+
331+
These shorthands also include `workflow_dispatch` automatically.
332+
333+
#### Deployment Incident Monitor Example
334+
335+
```aw wrap
336+
---
337+
on:
338+
deployment_status:
339+
state: [error, failure]
340+
workflow_dispatch:
341+
permissions:
342+
contents: read
343+
actions: read
344+
deployments: read
345+
tools:
346+
github:
347+
toolsets: [repos, actions]
348+
safe-outputs:
349+
create-issue:
350+
expires: 7d
351+
title-prefix: "[Incident] "
352+
labels: [incident, deployment-failure]
353+
close-older-issues: true
354+
skip-if-match: 'is:issue is:open label:incident label:deployment-failure'
355+
noop:
356+
---
357+
358+
# Deployment Incident Monitor
359+
360+
A deployment to ${{ github.event.deployment.environment }} has failed with state: ${{ github.event.deployment_status.state }}.
361+
362+
Investigate the root cause:
363+
1. Check the deployment workflow logs for the failing step
364+
2. Review recent commits to the deployed branch for potential causes
365+
3. Check if this environment has had recent failures (look for existing incident issues)
366+
367+
If a new incident is found, create an issue summarising the failure, the likely root cause, and the recommended next step.
368+
If an incident issue for this deployment already exists, call noop.
369+
```
370+
371+
See the [Natural Language Shorthands](#other-shorthands) section for additional shorthand formats.
372+
282373
### Command Triggers (`slash_command:`)
283374

284375
The `slash_command:` trigger creates workflows that respond to `/command-name` mentions in issues, pull requests, and comments.
@@ -727,6 +818,9 @@ on: dependabot pull request # PR from Dependabot (adds actor condition)
727818
on: security alert # Code scanning alert
728819
on: code scanning alert # Alias for security alert (code scanning alert)
729820
on: api dispatch custom-event # Repository dispatch with custom event type
821+
on: "deployment failed" # deployment_status with state == 'failure' guard
822+
on: "deployment error" # deployment_status with state == 'error' guard
823+
on: "deployment failed or error" # deployment_status with state == 'failure' or 'error' guard
730824
```
731825

732826
## Related Documentation

0 commit comments

Comments
 (0)