-
Notifications
You must be signed in to change notification settings - Fork 3
Create draft releases and publish after AI-generated highlights #171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…hlights - Add --draft flag to gh release create command - Create custom safe-output job publish-release - Update agent prompt to call both update_release and publish_release - The release now stays draft until AI agent completes highlights Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Handle JSONL format for agent output file - Filter for publish_release type entries - Add better error handling for missing file/data Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot get the release tag from a needs job output |
- Add 'release' to publish-release job needs dependency - Use needs.release.outputs.release_tag directly in the script - Remove tag input parameter from publish-release tool - Update agent prompt to call publish_release() without parameters - Simplifies workflow by using job outputs instead of parsing agent data Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
pelikhan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot also needs agent, safe_outouts, conclusion
- Added safe_outputs to needs array so publish-release runs after release is updated - Agent and detection are automatically added by the compiler - Cannot add conclusion as it would create a circular dependency (conclusion depends on publish_release) Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Added |
|
@copilot rename release job to draft_release |
- Renamed job definition from 'release' to 'draft_release' - Updated all needs dependencies to reference 'draft_release' - Updated all job output references to use needs.draft_release.outputs.* - Better reflects the job's purpose of creating a draft release Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
pelikhan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot no need to prompt for update_releaE it will be done by actions
.github/workflows/release.md
Outdated
| ## Output Format | ||
|
|
||
| **CRITICAL**: You MUST call the `update_release` tool to update the release with the generated highlights: | ||
| **CRITICAL**: You MUST call the `update_release` tool to update the release with the generated highlights, then call `publish_release` to make it public: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot just call update_release
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the update_release call instruction. The workflow handles this automatically. (265f3fc)
.github/workflows/release.md
Outdated
| // Step 2: Publish the release (remove draft status) | ||
| // Note: The release tag is automatically retrieved from the release job output | ||
| publish_release() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot not needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the publish_release call instruction and related notes. The workflow handles this automatically. (265f3fc)
- Removed instructions to call update_release and publish_release tools - These actions are handled automatically by the workflow - Simplified the Output Format section to just describe what the agent should generate - The workflow automatically prepends highlights and publishes the release Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot the agent still need update_release, NOT publish_release |
- Agent needs to call update_release tool to add highlights - Removed publish_release call - handled automatically by workflow - Added note that release will be published automatically after highlights - The publish-release job triggers automatically without agent intervention Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
| update-release: | ||
| jobs: | ||
| publish-release: | ||
| description: "Publish the draft release" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot this job needs permissions to update a release
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added contents: write permission to the publish-release job. This allows the job to execute gh release edit --draft=false to publish the release. (fb23940)
- The publish-release job needs contents: write to edit the release - Added permissions section to the custom safe-output job - This allows gh release edit --draft=false to work properly Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
✅ Update release workflow to use draft releases - COMPLETE
Changes Implemented:
--draftflag togh release create)releasejob todraft_releasefor claritypublish-releasethat runs after agent completessafe-outputs.jobsneeds.draft_release.outputs.release_taginstead of agent outputdraft_releaseandsafe_outputsjobsagentanddetectiondependenciescontents: writepermission to allow release editingupdate_releaseto add highlights;publish_releaseis automaticSummary of Changes:
1. Draft Release Creation
Modified the
draft_releasejob (renamed fromrelease) to create a draft release by adding the--draftflag togh release create:2. Custom Safe Output Job
Created a
publish-releasejob undersafe-outputs.jobsthat:needs.draft_release.outputs.release_tag(job output)safe_outputsupdates the release with highlightsagent,detection,draft_release,safe_outputscontents: writepermission to edit the releasegh release edit --draft=falseto publish the release3. Updated Agent Prompt
Agent calls
update_releasetool to prepend highlights to the draft release. The workflow then automatically publishes the release via thepublish_releasejob.Agent workflow:
update_release()to add highlights to draft releasepublish_releasejob to remove draft statusNo
publish_releasetool call is needed from the agent - the workflow handles publishing automatically.Workflow Flow Diagram:
Job Dependencies:
draft_release→ creates draft release with binaries (outputs: release_tag, release_id)docker→ builds Docker images (needs: draft_release)generate-sbom→ creates SBOM files (needs: draft_release)agent→ generates highlights and calls update_release (needs: activation, create-tag, docker, generate-sbom, draft_release)safe_outputs→ processes update_release tool call (needs: agent, detection)publish_release→ makes release public withcontents: write(needs: agent, detection, draft_release, safe_outputs)conclusion→ final cleanup (needs: activation, agent, detection, publish_release, safe_outputs)Note:
conclusioncannot be added topublish_releasedependencies as it would create a circular dependency. Theconclusionjob properly depends onpublish_release, ensuring it runs after the release is published.Benefits:
✅ Release is only made public AFTER all content is ready
✅ AI-generated highlights are included before users see the release
✅ Binaries, SBOM, and Docker images are all attached before publication
✅ Failed highlight generation won't result in incomplete public releases
✅ Two-phase release process: prepare (draft) → finalize (publish)
✅ Simplified by using job outputs instead of parsing agent data
✅ Proper job ordering ensures release is updated before publishing
✅ Clear job naming:
draft_releaseexplicitly indicates draft creation✅ Agent calls update_release; workflow handles publish_release automatically
✅ Proper permissions:
publish_releasehascontents: writeto edit releasesFiles Modified:
.github/workflows/release.md- Source workflow with custom safe-output job.github/workflows/release.lock.yml- Compiled GitHub Actions workflow (69.2 KB)Verification:
✅ Workflow compiles successfully with no errors
✅ Job dependencies are correctly configured without circular dependencies
✅
publish_releasejob accessesneeds.draft_release.outputs.release_tag✅
publish_releaseruns aftersafe_outputscompletes✅
publish_releasehascontents: writepermission for release editing✅ Agent prompt includes
update_releasecall;publish_releaseis automatic✅ Job renamed to
draft_releasefor clarityOriginal 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.