Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ jobs:
# be edited or have assets uploaded (HTTP 422). Delete the
# immutable release and recreate as a mutable draft so downstream
# jobs can upload assets. The tag persists across the delete/create
# cycle. The publish-release job converts the draft back to published.
# cycle. The publish-release job deletes the draft and recreates as published.
- name: Recreate release as draft for asset upload
if: ${{ steps.release.outputs.release_created == 'true' }}
env:
Expand All @@ -110,8 +110,9 @@ jobs:
TAG="${{ steps.release.outputs.tag_name }}"
REPO="${{ github.repository }}"
# Capture release metadata before deletion
gh release view "$TAG" --json body -q '.body' -R "$REPO" > /tmp/release-body.md
NAME=$(gh release view "$TAG" --json name -q '.name' -R "$REPO")
RELEASE_JSON=$(gh release view "$TAG" --json name,body -R "$REPO")
NAME=$(echo "$RELEASE_JSON" | jq -r '.name')
echo "$RELEASE_JSON" | jq -r '.body' > /tmp/release-body.md
# Delete immutable published release; tag is preserved
gh release delete "$TAG" --yes -R "$REPO"
# Recreate as mutable draft for asset upload
Expand Down Expand Up @@ -213,4 +214,13 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release edit "${{ needs.release-please.outputs.tag_name }}" --draft=false -R "${{ github.repository }}"
TAG="${{ needs.release-please.outputs.tag_name }}"
REPO="${{ github.repository }}"
# Capture draft release metadata
RELEASE_JSON=$(gh release view "$TAG" --json name,body -R "$REPO")
NAME=$(echo "$RELEASE_JSON" | jq -r '.name')
echo "$RELEASE_JSON" | jq -r '.body' > /tmp/release-body.md
# Delete mutable draft; recreate as published
gh release delete "$TAG" --yes -R "$REPO"
gh release create "$TAG" --verify-tag \
--title "$NAME" --notes-file /tmp/release-body.md -R "$REPO"
Comment on lines +219 to +226
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

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

Deleting the draft release here will also delete all release assets that were uploaded in the earlier attest-and-upload and upload-plugin-packages jobs. The subsequent gh release create recreates the release metadata but does not restore those assets, so the published release will end up missing binaries. Consider either (a) re-uploading the previously built artifacts after recreating the release (e.g., download workflow artifacts in this job and gh release upload them), or (b) using an API approach that can publish without deleting the release object (if GitHub allows it for your immutability mode).

Suggested change
# Capture draft release metadata
RELEASE_JSON=$(gh release view "$TAG" --json name,body -R "$REPO")
NAME=$(echo "$RELEASE_JSON" | jq -r '.name')
echo "$RELEASE_JSON" | jq -r '.body' > /tmp/release-body.md
# Delete mutable draft; recreate as published
gh release delete "$TAG" --yes -R "$REPO"
gh release create "$TAG" --verify-tag \
--title "$NAME" --notes-file /tmp/release-body.md -R "$REPO"
# Publish existing draft release without deleting assets
gh release edit "$TAG" --draft=false -R "$REPO"

Copilot uses AI. Check for mistakes.
Loading