Skip to content

fix: run post cleanup after failed jobs - #40

Merged
Piotr1215 merged 1 commit into
mainfrom
agent/post-always
Aug 4, 2026
Merged

fix: run post cleanup after failed jobs#40
Piotr1215 merged 1 commit into
mainfrom
agent/post-always

Conversation

@Piotr1215

Copy link
Copy Markdown
Contributor

Why

The action advertises its post step as exporting vind container logs and deleting the cluster, but post-if: success() skips that step precisely when a later test fails. Failed E2E jobs therefore lose the diagnostic artifact and leave cleanup to runner destruction.

This was found while dogfooding setup-vind for loft-router's Platform-through-router production canary.

What changed

  • Run the JavaScript post action under always() so log export and deletion execute after successful, failed, or cancelled jobs.
  • Add a regression test that reads the published action metadata and pins this lifecycle contract.
  • Clarify the behavior in the README.

TDD evidence

Before the metadata change, the new test failed with:

Expected pattern: post-if: always()
Received: post-if: success()

After the change:

  • npm test -- --runInBand: 15 tests passed.
  • npm run build: both checked-in action bundles rebuilt cleanly with no diff.
  • git diff --check: clean.

npm run lint is currently not runnable on main because the declared script invokes ESLint but ESLint is absent from package.json and the lockfile. That pre-existing packaging issue is intentionally outside this focused lifecycle fix.

Related: loft-sh/loft-router#23

@Piotr1215
Piotr1215 marked this pull request as ready for review August 4, 2026 18:30
@Piotr1215
Piotr1215 merged commit 926fd7d into main Aug 4, 2026
5 checks passed
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.

1 participant