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
|`output`| string | No | Success message returned to the agent |
229
+
|`needs`| string or array | No | Jobs that must complete before this job runs (see [Job Ordering](#job-ordering-needs)) |
229
230
|`permissions`| object | No | GitHub token permissions for the job |
230
231
|`env`| object | No | Environment variables for all steps |
231
232
|`if`| string | No | Conditional execution expression |
232
233
|`timeout-minutes`| number | No | Maximum job duration (GitHub Actions default: 360) |
233
234
235
+
### Job Ordering (`needs:`)
236
+
237
+
Use `needs:` to sequence a custom safe-output job relative to other jobs in the compiled workflow. Unlike manually patching `needs:` in the lock file (which gets overwritten on every recompile), `needs:` declared in the frontmatter persists across recompiles.
238
+
239
+
```yaml wrap
240
+
safe-outputs:
241
+
create-issue: {}
242
+
jobs:
243
+
post-process:
244
+
needs: safe_outputs # runs after the consolidated safe-outputs job
245
+
steps:
246
+
- run: echo "post-processing"
247
+
```
248
+
249
+
The compiler validates each `needs:` entry at compile time and fails with a clear error if the target does not exist. Target names with dashes are automatically normalized to underscores (e.g., `safe-outputs` → `safe_outputs`).
250
+
251
+
Valid `needs:` targets for custom safe-jobs:
252
+
253
+
| Target | Available when |
254
+
|--------|---------------|
255
+
| `agent` | Always |
256
+
| `safe_outputs` | At least one builtin handler, script, action, or user step is configured |
257
+
| `detection` | Threat detection is enabled |
258
+
| `upload_assets` | `upload-asset` is configured |
259
+
| `unlock` | `lock-for-agent` is enabled |
260
+
| `<job-name>` | That job exists in `safe-outputs.jobs` |
261
+
262
+
Self-dependencies and cycles between custom jobs are also caught at compile time.
0 commit comments