Use an if statement for the release-task artifact delete - #433
Merged
Conversation
The best-effort artifact-delete loop used a force-success tail to continue on a failed delete, but the write-safety rule bans that on a mutation, and the listing step two lines above already uses the compliant `if ! ...; then` form. Match it: the delete's result is read by the if, a failed delete surfaces a visible ::warning:: and the retention-days backstop still reaps the artifact, and the loop continues. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the github-release artifact cleanup logic in the reusable build-release-task workflow snippet to avoid a force-success tail on a state-changing GitHub API call, aligning the implementation with the repo's write-safety guidance for mutations.
Changes:
- Replaces
gh api ... || echo "::warning::..."with anif ! gh api ...; then ...; ficonstruct for artifact deletion warnings.
ptr727
added a commit
that referenced
this pull request
Jul 25, 2026
…) (#434) ## Promote develop to main Four doc/spec-only changes, all squashed to develop and Copilot-clean: - **#430** - README backlog: refresh the stale README + evaluate a lower-maintenance structure. - **#431** - README backlog: a linter-only Python type (codegen/boilerplate: no tests/coverage, linter only) distinct from the utility `python` type; ESPHome-Config `+python` deferred until it exists. - **#432** - `audit.py` branch check now splits "develop genuinely behind" (forward-sync) from "changed on both / develop may supersede", with a `classify_branch_drift()` helper + selftest. Surfaced by the PlexCleaner convergence, where develop was ahead but read as a forward-sync gap. - **#433** - canonical `build-release-task.yml` artifact-delete uses the `if ! …; then` form instead of a force-success tail (matches the listing step; write-safety compliant). Changes the `github-release` verbatim region → fleet re-vendors next cycle. No code/workflow changes to the hub's own pipeline - documentation and spec only, so no release fires on merge. ## Verification - `spec/validate.py` OK; `spec/audit.py --selftest` PASS. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Replaces the force-success tail on the artifact-delete in
build-release-task.yml'sgithub-releasecleanup step with theif ! …; thenform.Why
Routed upstream from the PlexCleaner convergence (ptr727/PlexCleaner#880): Copilot flagged a force-success tail on a mutation, which the write-safety rule bans. The listing step two lines above already uses the compliant
if ! ids=$(…); thenform, so the delete was internally inconsistent. The new form reads the delete's result via theif, surfaces a failed delete as a visible::warning::, and theretention-days: 1backstop still reaps the artifact - functionally identical, rule-compliant.Changes the
github-releaseverbatim region, so it re-vendors fleet-wide next cycle.Verification
YAML valid,
spec/audit.py --selftestPASS,spec/validate.pyOK.🤖 Generated with Claude Code