You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/content/docs/reference/playwright.md
+55-3Lines changed: 55 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -105,36 +105,88 @@ Create an issue for each category of problems found.
105
105
106
106
### Visual Regression Testing
107
107
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
+
108
110
```aw wrap
109
111
---
110
112
on:
111
113
pull_request:
112
114
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
113
144
114
145
tools:
115
146
playwright:
147
+
version: "v1.52.0"
148
+
bash:
149
+
- "npm *"
150
+
- "curl http://localhost:*"
116
151
117
152
network:
118
153
allowed:
119
154
- defaults
120
155
- playwright
121
-
- github
156
+
- local
157
+
- node
122
158
123
159
permissions:
124
160
contents: read
125
161
126
162
safe-outputs:
127
163
add-comment:
128
164
max: 1
165
+
noop:
129
166
---
130
167
131
168
# Visual Regression Check
132
169
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
134
178
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.
136
180
```
137
181
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.
Copy file name to clipboardExpand all lines: docs/src/content/docs/reference/triggers.md
+94Lines changed: 94 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -279,6 +279,97 @@ Workflows with `workflow_run` triggers include automatic security protections:
279
279
280
280
See the [Security Architecture](/gh-aw/introduction/architecture/) for details.
281
281
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
> 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.
0 commit comments