From 66baeb31ab926da71c386d637c4ba113610204d5 Mon Sep 17 00:00:00 2001 From: Pieter Viljoen Date: Fri, 24 Jul 2026 19:50:47 -0700 Subject: [PATCH] Use an if statement for the release-task artifact delete 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 --- catalog/snippets/workflows/build-release-task.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/catalog/snippets/workflows/build-release-task.yml b/catalog/snippets/workflows/build-release-task.yml index 4f1f7759..cf1159d7 100644 --- a/catalog/snippets/workflows/build-release-task.yml +++ b/catalog/snippets/workflows/build-release-task.yml @@ -253,6 +253,7 @@ jobs: ids="" fi for id in $ids; do - gh api --method DELETE "repos/$GITHUB_REPOSITORY/actions/artifacts/$id" \ - || echo "::warning::Failed to delete artifact $id; retention-days backstop will reap it." + if ! gh api --method DELETE "repos/$GITHUB_REPOSITORY/actions/artifacts/$id"; then + echo "::warning::Failed to delete artifact $id; retention-days backstop will reap it." + fi done