Add update-release safe output for modifying GitHub release descriptions#4278
Add update-release safe output for modifying GitHub release descriptions#4278
Conversation
…lementation Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
…kflow - Added "prepend" operation to update-release safe output - Prepend adds content at the start with horizontal line separator and AI footer - Updated compute_text.cjs to handle release events and workflow_dispatch inputs - Added support for release_url and release_id inputs in workflow_dispatch - Updated dev.md workflow to trigger on release events and prepend summaries - All tests updated and passing (7 update_release tests, 1005 total JS tests) Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Implemented all three requested features in commit 817c0a0: 1. Prepend operation ✅
2. GitHub context with release ID ✅
3. Updated dev.md workflow ✅
All tests passing (1005 JS tests, all Go tests). Ready for review! |
- Made 'tag' field optional in UpdateReleaseOutput schema - Updated TypeScript types to reflect optional tag - Modified update_release.cjs to infer tag from event context when missing: - From github.event.release.tag_name for release events - From release_url input by parsing URL for workflow_dispatch - From release_id input by fetching release for workflow_dispatch - Updated validation to accept omitted tag field - Added tests for tag inference from event context - Added test for graceful failure when tag cannot be inferred - Updated dev.md workflow example to show optional tag usage - All tests passing (9 update_release tests, 1007 total JS tests) Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Implemented tag inference from release event context in commit 703a604: Tag Field Now Optional ✅
Automatic Tag Inference ✅
Example Usage: {"type": "update_release", "operation": "prepend", "body": "## AI Summary\n\nKey highlights"}When triggered by a release event, the tag is automatically inferred. The workflow fails gracefully with a clear error if tag cannot be inferred from context. Updated dev.md workflow to demonstrate the new optional tag behavior. All tests passing (9 update_release tests, 1007 total JS tests). |
✅ Dev Hawk Report - SuccessWorkflow Run: #2993
SummaryThe Dev workflow completed successfully! 🎉 Latest Commit:
This change enhances the update-release safe output feature by making the tag field optional and automatically inferring it from the GitHub event context, improving the developer experience.
|
- Added update_release tool definition to safe_outputs_tools.json - Tool supports three operations: replace, append, prepend - Tag field is optional and inferred from event context - Updated test expectations to include update_release tool - All tests passing (including TestGetSafeOutputsToolsJSON) Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Added The tool definition includes:
All tests passing. |
.github/workflows/dev.md
Outdated
| engine: copilot | ||
| permissions: | ||
| contents: read | ||
| contents: write |
|
|
@copilot review the JavaScript that does safe output type ingestion for update release. See error in https://github.com/githubnext/gh-aw/actions/runs/19484470074/job/55763523819#step:26:1 |
I've reviewed the update_release ingestion code in Could you provide the specific error message from the workflow run? The link points to step 26, but I need to see the actual error output to diagnose the issue. You can:
The current implementation validates:
All 9 unit tests pass including validation tests.
Fixed the directory creation issue in commit dbc8037. The problem was in |
- Changed fs.mkdirSync from "/tmp" to "/tmp/gh-aw" to ensure parent directory exists - This fixes the file write error when creating agent_output.json - All tests passing (1007 JS tests) Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot merge main |
…lease-output # Conflicts: # .github/workflows/ai-triage-campaign.lock.yml # .github/workflows/archie.lock.yml # .github/workflows/artifacts-summary.lock.yml # .github/workflows/audit-workflows.lock.yml # .github/workflows/blog-auditor.lock.yml # .github/workflows/brave.lock.yml # .github/workflows/changeset.lock.yml # .github/workflows/ci-doctor.lock.yml # .github/workflows/cli-consistency-checker.lock.yml # .github/workflows/cli-version-checker.lock.yml # .github/workflows/cloclo.lock.yml # .github/workflows/commit-changes-analyzer.lock.yml # .github/workflows/copilot-agent-analysis.lock.yml # .github/workflows/copilot-pr-nlp-analysis.lock.yml # .github/workflows/copilot-pr-prompt-analysis.lock.yml # .github/workflows/copilot-session-insights.lock.yml # .github/workflows/craft.lock.yml # .github/workflows/daily-code-metrics.lock.yml # .github/workflows/daily-doc-updater.lock.yml # .github/workflows/daily-file-diet.lock.yml # .github/workflows/daily-firewall-report.lock.yml # .github/workflows/daily-multi-device-docs-tester.lock.yml # .github/workflows/daily-news.lock.yml # .github/workflows/daily-repo-chronicle.lock.yml # .github/workflows/daily-team-status.lock.yml # .github/workflows/dependabot-go-checker.lock.yml # .github/workflows/dev-hawk.lock.yml # .github/workflows/dev.lock.yml # .github/workflows/developer-docs-consolidator.lock.yml # .github/workflows/dictation-prompt.lock.yml # .github/workflows/docs-noob-tester.lock.yml # .github/workflows/duplicate-code-detector.lock.yml # .github/workflows/example-workflow-analyzer.lock.yml # .github/workflows/github-mcp-tools-report.lock.yml # .github/workflows/go-logger.lock.yml # .github/workflows/go-pattern-detector.lock.yml # .github/workflows/grumpy-reviewer.lock.yml # .github/workflows/instructions-janitor.lock.yml # .github/workflows/issue-classifier.lock.yml # .github/workflows/lockfile-stats.lock.yml # .github/workflows/mcp-inspector.lock.yml # .github/workflows/mergefest.lock.yml # .github/workflows/notion-issue-summary.lock.yml # .github/workflows/pdf-summary.lock.yml # .github/workflows/plan.lock.yml # .github/workflows/poem-bot.lock.yml # .github/workflows/pr-nitpick-reviewer.lock.yml # .github/workflows/prompt-clustering-analysis.lock.yml # .github/workflows/python-data-charts.lock.yml # .github/workflows/q.lock.yml # .github/workflows/repo-tree-map.lock.yml # .github/workflows/repository-quality-improver.lock.yml # .github/workflows/research.lock.yml # .github/workflows/safe-output-health.lock.yml # .github/workflows/schema-consistency-checker.lock.yml # .github/workflows/scout.lock.yml # .github/workflows/security-fix-pr.lock.yml # .github/workflows/semantic-function-refactor.lock.yml # .github/workflows/smoke-claude.lock.yml # .github/workflows/smoke-codex.lock.yml # .github/workflows/smoke-copilot.lock.yml # .github/workflows/smoke-detector.lock.yml # .github/workflows/static-analysis-report.lock.yml # .github/workflows/super-linter.lock.yml # .github/workflows/technical-doc-writer.lock.yml # .github/workflows/test-ollama-threat-detection.lock.yml # .github/workflows/tidy.lock.yml # .github/workflows/typist.lock.yml # .github/workflows/unbloat-docs.lock.yml # .github/workflows/video-analyzer.lock.yml # .github/workflows/weekly-issue-summary.lock.yml # pkg/workflow/js/collect_ndjson_output.cjs # pkg/workflow/js/types/safe-outputs-config.d.ts # pkg/workflow/js/types/safe-outputs.d.ts # schemas/agent-output.json
- Merged origin/main into copilot/add-update-release-output branch - Resolved conflicts in schemas and TypeScript type files - Added both UpdateReleaseOutput and NoOpOutput to schema - Regenerated all workflow lock files with updated compiler - All tests passing (1028 JS tests, all Go tests) - Workflows compiled successfully (80 workflows, 0 errors) Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot the list of safe output types should contain update_release . As you can see the ingestion step fails because the tool is refused. Report: https://github.com/githubnext/gh-aw/actions/runs/19489819272/job/55779735870#step:26:1 |
|
- Added update_release configuration to generateSafeOutputsConfig() - Added update_release tool to generateFilteredToolsJSON() - Also added missing noop configuration to generateSafeOutputsConfig() - This fixes the ingestion error where update_release tool was rejected - All tests passing, 80 workflows compiled successfully Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Fixed in commit bc7c250. The issue was that
The tool is now properly added to both |
✅ Dev Hawk Report - SuccessWorkflow Run: #2999
SummaryThe Dev workflow completed successfully! 🎉 This workflow validated the changes to add
All tests passed and 80 workflows compiled successfully.
|
There was a problem hiding this comment.
Pull Request Overview
This PR adds a comprehensive "update-release" safe output type that enables AI agents to modify GitHub release descriptions with three operations (replace, append, prepend). The implementation includes full schema validation, Go backend integration, JavaScript execution logic, comprehensive test coverage, and proper documentation. The PR also fixes a bug in directory creation and adds GitHub context support for release events.
Key Changes
- New
update-releasesafe output with three operations: replace (full replacement), append (add at end with separator), prepend (add at start with separator) - Tag inference from release event context or workflow dispatch inputs
- Integration with safe outputs config generation and tools JSON filtering
- Comprehensive validation in collection, schema, and runtime layers
- Bug fix for directory creation in
collect_ndjson_output.cjs(changed from/tmpto/tmp/gh-aw)
Reviewed Changes
Copilot reviewed 90 out of 92 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
schemas/agent-output.json |
Adds UpdateReleaseOutput schema definition with validation for tag, operation, and body fields |
pkg/workflow/update_release.go |
Implements UpdateReleaseConfig struct and job building logic following existing safe output patterns |
pkg/workflow/scripts.go |
Adds embedding and bundling for update_release.cjs script |
pkg/workflow/safe_outputs.go |
Integrates update_release into config generation and tools JSON filtering |
pkg/workflow/js/update_release.cjs |
Core implementation with tag inference, operation handling, and staged mode support |
pkg/workflow/js/update_release.test.cjs |
Comprehensive test coverage (9 tests) covering all operations and edge cases |
pkg/workflow/js/collect_ndjson_output.cjs |
Adds validation logic and fixes directory creation bug |
pkg/workflow/js/compute_text.cjs |
Adds release event and workflow_dispatch support for release context extraction |
pkg/workflow/js/safe_outputs_tools.json |
Defines update_release tool with proper schema and descriptions |
.github/workflows/dev.md |
Updates example workflow to demonstrate update-release usage with prepend operation |
Multiple .lock.yml files |
Consistent integration of validation code and noop configuration across all workflows |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add documentation for three new features merged in the last 24 hours: 1. Update-release safe output (PR #4278) - Added to safe outputs table - Full documentation with operations (replace, append, prepend) - Agent output format examples - Configuration options 2. No-op safe output (PR #4286) - Added to safe outputs table - Documentation explaining transparency and auto-enable - Agent output format examples - Use cases for silent completion prevention 3. Skip-if-match trigger condition (PR #4287) - Added to triggers reference - How it works explanation - Three common use case examples - GitHub search query integration details 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Summary: Add "update-release" Safe Output Type ✅
Successfully implemented a new safe output type
update-releasethat allows AI agents to update GitHub release descriptions with three operations: replace, append, and prepend.Features Implemented
Operations:
---) and AI attribution footerConfiguration Options:
JSONL Output Format:
{"type": "update_release", "tag": "v1.0.0", "operation": "replace", "body": "New release notes"} {"type": "update_release", "tag": "v2.0.0", "operation": "append", "body": "Additional content"} {"type": "update_release", "tag": "v3.0.0", "operation": "prepend", "body": "Summary content"} {"type": "update_release", "operation": "prepend", "body": "Tag inferred from context"}Implementation Complete
1. Prepend Operation ✅
2. GitHub Context for Releases ✅
compute_text.cjsto extract release content fromgithub.event.releaserelease_urlandrelease_idinputs${{ needs.activation.outputs.text }}3. Updated dev.md Workflow ✅
releaseevents andworkflow_dispatchprependoperation with minimal permissions (contents: read)update_releasetool is missing4. Tag Inference from Context ✅
5. Safe Outputs Tools Integration ✅
update_releasetool tosafe_outputs_tools.json6. Bug Fix ✅
collect_ndjson_output.cjs7. Merged with Main ✅
8. Config Generation Fix ✅ (NEW)
update_releasetogenerateSafeOutputsConfig()functionupdate_releasetogenerateFilteredToolsJSON()functionnoopconfiguration/tmp/gh-aw/safeoutputs/config.jsonImplementation Quality
All tests pass, workflows compile successfully. Ready for final review and merge!
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.