Skip to content

fix(ci): clean leftover draft nightly releases before recreating#14229

Merged
moabu merged 1 commit into
mainfrom
ci/clean-nightly-draft-releases
Jun 8, 2026
Merged

fix(ci): clean leftover draft nightly releases before recreating#14229
moabu merged 1 commit into
mainfrom
ci/clean-nightly-draft-releases

Conversation

@mo-auto

@mo-auto mo-auto commented Jun 8, 2026

Copy link
Copy Markdown
Member

Summary

The nightly Build and Publish leaves draft nightly releases lying around instead of a single pre-release, and they accumulate over time.

Cause: the SLSA provenance job (slsa-github-generator with upload-assets: true, upload-tag-name: nightly) creates a draft release on the nightly tag, and build-nightly-build's gh release delete nightly only removes the published release — the draft sharing the tag is left behind, so a new draft piles up each cycle.

Fix: before recreating the nightly pre-release, delete every release pointing at the nightly tag (drafts included) by id, then drop the tag as before.

Notes

Summary by CodeRabbit

  • Chores
    • Improved the nightly build workflow's release artifact cleanup process for more reliable nightly build operations.

The SLSA provenance upload-assets step creates draft releases on the nightly tag, and
'gh release delete nightly' only removes the published release - so draft 'nightly' releases
accumulate (seen as draft instead of pre-release). Before recreating the nightly pre-release,
delete every release on the nightly tag (drafts included) by id.

Signed-off-by: moauto <54212639+mo-auto@users.noreply.github.com>
@mo-auto mo-auto requested a review from moabu as a code owner June 8, 2026 07:50
@mo-auto

mo-auto commented Jun 8, 2026

Copy link
Copy Markdown
Member Author

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 79c34c33-663b-43ba-b9db-181ed04a3473

📥 Commits

Reviewing files that changed from the base of the PR and between feed511 and 8ddd2c0.

📒 Files selected for processing (1)
  • .github/workflows/build-nightly-build.yml

📝 Walkthrough

Walkthrough

The nightly build workflow is updated to explicitly delete all GitHub releases matching the nightly tag by querying the releases API, filtering for tag name "nightly", and deleting each matching release ID before proceeding with existing cleanup steps. Individual deletion errors are suppressed.

Changes

CI Nightly Release Cleanup

Layer / File(s) Summary
Explicit nightly release deletion via gh api
.github/workflows/build-nightly-build.yml
Workflow adds a bash loop that queries all repository releases, filters those matching the nightly tag, and deletes each release by ID while suppressing individual deletion errors before existing tag cleanup.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Suggested labels

kind-bug, area-CI

Suggested reviewers

  • moabu
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description provides clear context (target issue, implementation details) but does not follow the required template structure with explicit sections and checklists. Restructure the description to match the required template: add 'Target issue' section with issue reference, use 'Implementation Details' heading, and complete the test/documentation checklist.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: cleaning up leftover draft nightly releases before recreating the nightly release.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/clean-nightly-draft-releases

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@mo-auto mo-auto added area-CI Issue or changes required in automatic builds or CI infrastructure kind-bug Issue or PR is a bug in existing functionality labels Jun 8, 2026
@moabu moabu merged commit a99a5ee into main Jun 8, 2026
3 checks passed
@moabu moabu deleted the ci/clean-nightly-draft-releases branch June 8, 2026 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-CI Issue or changes required in automatic builds or CI infrastructure kind-bug Issue or PR is a bug in existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants