docs: surface upload-artifact for attachment-style safe outputs#32669
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
upload-artifact for attachment-style safe outputs
|
Hey One small flag from the automated checklist:
If you'd like to address this automatically, you can assign the following prompt to a coding agent:
|
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Updates agentic workflow authoring docs to explicitly recommend safe-outputs: upload-artifact as an attachment-style output channel, and documents skip-archive for unarchived downloads.
Changes:
- Expanded “safe output” guidance across authoring/update prompts to include
upload-artifactfor attachment-style outputs. - Updated
safe-outputsdocumentation to position artifacts as suitable for arbitrary downloadable deliverables (not just temporary bundles). - Added frontmatter examples enabling
upload-artifactwithskip-archive: truefor direct-file consumption.
Show a summary per file
| File | Description |
|---|---|
| .github/aw/update-agentic-workflow.md | Adds upload-artifact to safe-output guidance and shows an example enabling skip-archive. |
| .github/aw/safe-outputs.md | Updates upload-artifact description and configuration example to emphasize attachment-style outputs and skip-archive. |
| .github/aw/github-agentic-workflows.md | Updates canonical workflow template/frontmatter example to include upload-artifact with skip-archive. |
| .github/aw/create-shared-agentic-workflow.md | Adds upload-artifact to the “common safe outputs” list for shared components. |
| .github/aw/create-agentic-workflow.md | Expands security and workflow-authoring guidance to include artifact/attachment uploads via safe-outputs. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comments suppressed due to low confidence (1)
.github/aw/safe-outputs.md:560
skip-archiveonly disables zip archiving for single-file uploads (per shared config docs and reference). The current wording implies it applies to any upload and may mislead readers into expecting multi-file bundles to download uncompressed. Please clarify the single-file limitation here (and in the paragraph below).
defaults: # Optional: default values injected when agent omits a field
if-no-files: "ignore" # "error" or "ignore" when no files match (default: "error")
skip-archive: true # Optional: allow direct file uploads without zipping
Uploads files as run-scoped GitHub Actions artifacts. Artifacts are temporary and tied to the workflow run, automatically cleaned up when they expire. Agents call upload_artifact with a name, path, and optional retention_days. Use this for temporary downloadable artifacts and attachment-style arbitrary data (for example when a comment/issue should link to a generated file bundle). Set skip-archive: true when downloads should be served as direct files without uncompressing. Use upload-asset instead when you need stable embeddable URLs (images/charts in GitHub content).
dispatch-workflow:- Trigger other workflows with inputs
</details>
- **Files reviewed:** 5/5 changed files
- **Comments generated:** 4
| 4. **Safe Outputs**: For any write operations: | ||
| - Creating issues → `safe-outputs: create-issue:` | ||
| - Commenting → `safe-outputs: add-comment:` | ||
| - Posting attachment-style outputs or arbitrary downloadable files → `safe-outputs: upload-artifact:` (set `skip-archive: true` when consumers should download files directly without uncompressing) |
| - Never grant direct write permissions in shared components | ||
| - Use `safe-outputs:` configuration for all write operations | ||
| - Common safe outputs: `create-issue`, `add-comment`, `create-pull-request`, `update-issue` (for editing), `close-issue` (for closing), `dispatch-workflow` | ||
| - Common safe outputs: `create-issue`, `add-comment`, `create-pull-request`, `update-issue` (for editing), `close-issue` (for closing), `upload-artifact` (for attachment-style arbitrary data, optionally unarchived), `dispatch-workflow` |
| @@ -553,11 +553,10 @@ Safe outputs are the primary mechanism for write operations in agentic workflows | |||
| exclude: ["*secret*"] | |||
| defaults: # Optional: default values injected when agent omits a field | |||
| if-no-files: "ignore" # "error" or "ignore" when no files match (default: "error") | |||
| allow: # Optional: opt-in behaviors | |||
| skip-archive: true # Allow agent to upload files without zipping | |||
| skip-archive: true # Optional: allow direct file uploads without zipping | |||
| ``` | |||
| labels: [automated] | ||
| add-comment: # NEW - just add this line and its config | ||
| max: 1 | ||
| upload-artifact: # NEW - for attachment-style outputs | ||
| skip-archive: true |
Instruction docs currently emphasize issue/comment/PR safe outputs but under-signal that
upload-artifactcan serve as an attachment channel for arbitrary generated data. This update makes artifact-based attachments explicit and documents unarchived delivery for direct consumption.Safe-output guidance expanded
upload-artifactalongsidecreate-issue,add-comment, andcreate-pull-requestin workflow-authoring guidance.Attachment semantics clarified
upload-artifactas suitable for attachment-style arbitrary data, not only temporary report bundles.allow.skip-archive: trueenables direct-file downloads (no unzip step).Instruction coverage aligned across files
github-agentic-workflows.md,create-agentic-workflow.md,update-agentic-workflow.md,create-shared-agentic-workflow.md,safe-outputs.md) to keep recommendations consistent.