Skip to content

Mark artifact-cleanup step continue-on-error so it never reds the run - #201

Merged
ptr727 merged 2 commits into
developfrom
cleanup-continue-on-error
Jun 24, 2026
Merged

Mark artifact-cleanup step continue-on-error so it never reds the run#201
ptr727 merged 2 commits into
developfrom
cleanup-continue-on-error

Conversation

@ptr727

@ptr727 ptr727 commented Jun 24, 2026

Copy link
Copy Markdown
Owner

Surfaced by Copilot on the NxWitness re-sync (ptr727/NxWitness#443) — a valid concern carried back to the template.

Problem

The cleanup-artifacts step is documented as best-effort ("never red the run"), but set -euo pipefail + the per-command guards (if ! on the list, || echo ::warning:: on each delete) only cover the expected failures. A truly unexpected failure — gh itself crashing, an auth glitch, anything unguarded — would still fail the job under set -e and red the run.

Fix

Add continue-on-error: true to the delete step in both publish-release.yml and test-pull-request.yml, so the best-effort guarantee is enforced at the workflow level regardless of failure mode. The in-script guards stay (they still emit warnings and delete as many artifacts as possible despite individual failures); continue-on-error is the belt-and-suspenders that guarantees the step never reds the run. AGENTS.md cleanup recipe updated to include it.

Docs/workflow-only; line endings preserved; both workflows parse.

🤖 Generated with Claude Code

The cleanup-artifacts step is best-effort, but set -euo pipefail + the
per-command guards only cover expected list/delete failures; a truly
unexpected failure (e.g. gh itself) would still fail the job and red the
run. Add continue-on-error: true to the delete step in both
publish-release.yml and test-pull-request.yml so the best-effort intent
is enforced at the workflow level, and note it in the AGENTS.md recipe.

Surfaced by Copilot on the NxWitness re-sync (ptr727/NxWitness#443).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 24, 2026 01:22
Keep the intent note to a single concise line; don't grow comments.

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 hardens the GitHub Actions artifact-cleanup housekeeping so it cannot fail a workflow run, aligning the workflows with the documented “best-effort, never red the run” guarantee.

Changes:

  • Add continue-on-error: true to the “Delete workflow artifacts” step in both entry-point workflows so unexpected failures (e.g., gh crashes/auth glitches) cannot fail the run.
  • Update AGENTS.md to document the new continue-on-error requirement for cleanup steps.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
AGENTS.md Updates the workflow conventions text to require continue-on-error: true on artifact deletion steps.
.github/workflows/test-pull-request.yml Makes artifact cleanup step non-fatal via continue-on-error: true while keeping in-script warning/guard behavior.
.github/workflows/publish-release.yml Makes artifact cleanup step non-fatal via continue-on-error: true while keeping in-script warning/guard behavior.

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

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

@ptr727
ptr727 merged commit da2da68 into develop Jun 24, 2026
10 checks passed
ptr727 added a commit to ptr727/NxWitness that referenced this pull request Jun 24, 2026
Follows the template's fix (ptr727/ProjectTemplate#201) for the
cleanup-artifacts best-effort intent that Copilot flagged on #443:
add continue-on-error: true to the Delete workflow artifacts step in
both publish-release.yml and test-pull-request.yml, and drop the now
redundant inner run-block comment so the step matches the template.
ptr727 added a commit that referenced this pull request Jun 24, 2026
Promotes the current `develop` head to `main`.

Contents:
- **#201** — `continue-on-error: true` on the `cleanup-artifacts` delete
step in `publish-release.yml` and `test-pull-request.yml` so best-effort
housekeeping can never red the run (from NxWitness#443 Copilot review).

Standard release promotion: merge (not squash). Publishing remains
deferred until the artifact-storage quota recalculates.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
ptr727 added a commit that referenced this pull request Jun 25, 2026
Surfaced by Copilot during the NxWitness re-sync
([#448](ptr727/NxWitness#448)) — a real
regression from the `pull_request_target` switch (#201).

Under `pull_request_target`, `github.ref` resolves to the **base
branch**, so the merge-bot concurrency group `…-${{ github.ref }}`
serialized *every* bot PR against a base into one queue — delaying
auto-merge/disable when multiple Dependabot/codegen PRs are open. Keying
on `github.event.pull_request.number` restores per-PR scoping (a PR's
events still process in arrival order; different PRs run concurrently).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ptr727
ptr727 deleted the cleanup-continue-on-error branch July 7, 2026 21:05
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