Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 11, 2026

✅ Update release workflow to use draft releases - COMPLETE

Changes Implemented:

  • Understand current workflow structure
  • Modify draft_release job to create draft release (add --draft flag to gh release create)
  • Rename release job to draft_release for clarity
  • Add new job publish-release that runs after agent completes
    • Created as custom safe-output job under safe-outputs.jobs
    • Gets release tag from needs.draft_release.outputs.release_tag instead of agent output
    • Updated: Depends on draft_release and safe_outputs jobs
    • Compiler automatically adds agent and detection dependencies
    • Added contents: write permission to allow release editing
    • Publishes the release (removes draft status)
  • Update job dependencies so publish-release runs after safe-outputs update
  • Updated agent prompt: Agent calls update_release to add highlights; publish_release is automatic
  • Test and validate the changes (compiled successfully)

Summary of Changes:

1. Draft Release Creation

Modified the draft_release job (renamed from release) to create a draft release by adding the --draft flag to gh release create:

gh release create "$RELEASE_TAG" \
  --draft \
  --title "$RELEASE_TAG" \
  --generate-notes \
  dist/*

2. Custom Safe Output Job

Created a publish-release job under safe-outputs.jobs that:

  • Takes release tag from needs.draft_release.outputs.release_tag (job output)
  • Runs after safe_outputs updates the release with highlights
  • Depends on: agent, detection, draft_release, safe_outputs
  • Has contents: write permission to edit the release
  • Calls gh release edit --draft=false to publish the release
  • Automatically triggered by the workflow (no agent tool call needed)

3. Updated Agent Prompt

Agent calls update_release tool to prepend highlights to the draft release. The workflow then automatically publishes the release via the publish_release job.

Agent workflow:

  1. Agent calls update_release() to add highlights to draft release
  2. Workflow automatically triggers publish_release job to remove draft status

No publish_release tool call is needed from the agent - the workflow handles publishing automatically.

Workflow Flow Diagram:

[Create Tag] → [Build/Test] → [Create Draft Release ⚠️ DRAFT]
                                      ↓
[Generate SBOM] ← [Build Docker] ← [Draft Release]
       ↓
[AI Agent] → Generates highlights and calls update_release
       ↓
[safe_outputs] → Processes update_release and prepends highlights to draft
       ↓
[publish_release] → Automatically removes draft status ✅ PUBLIC
     ↑ (contents: write permission)
     └─ Gets tag from needs.draft_release.outputs.release_tag
       └─ Waits for safe_outputs to complete

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 with contents: write (needs: agent, detection, draft_release, safe_outputs)
  • conclusion → final cleanup (needs: activation, agent, detection, publish_release, safe_outputs)

Note: conclusion cannot be added to publish_release dependencies as it would create a circular dependency. The conclusion job properly depends on publish_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_release explicitly indicates draft creation
✅ Agent calls update_release; workflow handles publish_release automatically
Proper permissions: publish_release has contents: write to edit releases

Files 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_release job accesses needs.draft_release.outputs.release_tag
publish_release runs after safe_outputs completes
publish_release has contents: write permission for release editing
✅ Agent prompt includes update_release call; publish_release is automatic
✅ Job renamed to draft_release for clarity

Custom agent used: create-agentic-workflow
Design agentic workflows using GitHub Agentic Workflows (gh-aw) extension with interactive guidance on triggers, tools, and security best practices.

Original prompt

Update release.md to create a draft PR in the create release phase and make it non draft in a separate job that needs the agent, and the release id, etc...

Custom agent used: create-agentic-workflow
Design agentic workflows using GitHub Agentic Workflows (gh-aw) extension with interactive guidance on triggers, tools, and security best practices.


💡 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.

Copilot AI and others added 2 commits January 11, 2026 20:52
…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 AI changed the title [WIP] Update release.md for draft PR creation Create draft releases and publish after AI-generated highlights Jan 11, 2026
Copilot AI requested a review from pelikhan January 11, 2026 20:56
@pelikhan
Copy link
Collaborator

@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>
Copy link
Contributor Author

Copilot AI commented Jan 11, 2026

@copilot get the release tag from a needs job output

Changed the publish-release job to get the release tag from needs.release.outputs.release_tag instead of parsing the agent output. The job now has release in its dependencies and directly accesses the job output. (5d3dfab)

Copy link
Collaborator

@pelikhan pelikhan left a 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>
Copy link
Contributor Author

Copilot AI commented Jan 11, 2026

@copilot also needs agent, safe_outouts, conclusion

Added safe_outputs to the needs array. The compiler automatically includes agent and detection dependencies. Note that conclusion cannot be added as it would create a circular dependency - conclusion already depends on publish_release, so the execution order is correct: publish_release → conclusion. (18bed4d)

Copilot AI requested a review from pelikhan January 11, 2026 21:13
@pelikhan pelikhan marked this pull request as ready for review January 11, 2026 21:35
@pelikhan
Copy link
Collaborator

@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>
Copy link
Contributor Author

Copilot AI commented Jan 12, 2026

@copilot rename release job to draft_release

Renamed the job from release to draft_release and updated all references throughout the workflow including needs dependencies and output references. (f6f3212)

Copy link
Collaborator

@pelikhan pelikhan left a 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

## 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:
Copy link
Collaborator

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

Copy link
Contributor Author

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)

Comment on lines 573 to 575
// Step 2: Publish the release (remove draft status)
// Note: The release tag is automatically retrieved from the release job output
publish_release()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot not needed

Copy link
Contributor Author

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>
Copy link
Contributor Author

Copilot AI commented Jan 12, 2026

@copilot no need to prompt for update_releaE it will be done by actions

Removed the manual tool call instructions from the agent prompt. The workflow now handles update_release and publish_release automatically. (265f3fc)

Copilot AI requested a review from pelikhan January 12, 2026 00:23
@pelikhan
Copy link
Collaborator

@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>
Copy link
Contributor Author

Copilot AI commented Jan 12, 2026

@copilot the agent still need update_release, NOT publish_release

Restored the update_release tool call instructions for the agent. The publish_release remains automatic - it's triggered by the workflow after the agent updates the release. (1e1370d)

update-release:
jobs:
publish-release:
description: "Publish the draft release"
Copy link
Collaborator

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

Copy link
Contributor Author

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>
Copilot AI requested a review from pelikhan January 12, 2026 00:39
@pelikhan pelikhan closed this Jan 12, 2026
@lpcox lpcox deleted the copilot/update-release-draft-pr branch January 24, 2026 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants