Skip to content

Use an if statement for the release-task artifact delete - #433

Merged
ptr727 merged 1 commit into
developfrom
release-task-artifact-delete-if-form
Jul 25, 2026
Merged

Use an if statement for the release-task artifact delete#433
ptr727 merged 1 commit into
developfrom
release-task-artifact-delete-if-form

Conversation

@ptr727

@ptr727 ptr727 commented Jul 25, 2026

Copy link
Copy Markdown
Owner

What

Replaces the force-success tail on the artifact-delete in build-release-task.yml's github-release cleanup step with the if ! …; then form.

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=$(…); then form, so the delete was internally inconsistent. The new form reads the delete's result via the if, surfaces a failed delete as a visible ::warning::, and the retention-days: 1 backstop still reaps the artifact - functionally identical, rule-compliant.

Changes the github-release verbatim region, so it re-vendors fleet-wide next cycle.

Verification

YAML valid, spec/audit.py --selftest PASS, spec/validate.py OK.

🤖 Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings July 25, 2026 02:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 an if ! gh api ...; then ...; fi construct for artifact deletion warnings.

@ptr727
ptr727 merged commit 801ca09 into develop Jul 25, 2026
7 checks passed
@ptr727
ptr727 deleted the release-task-artifact-delete-if-form branch July 25, 2026 03:51
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)
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