From 56852a81091ad692efe691c63ab7e22fa42cc33f Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Fri, 9 Aug 2024 20:15:41 +0200 Subject: [PATCH] Remove dangling containers after failed execution --- .github/workflows/tests.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index eefea88..e4d4fec 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -35,3 +35,6 @@ jobs: env: RAILS_ENV: test DATABASE_URL: postgres://postgres:postgres@postgres:5432/postgres + - name: Clean up containers generated by this flow + if: failure() + run: docker ps --filter network=$JOB_CONTAINER_NAME-$GITHUB_JOB-network --filter name=$JOB_CONTAINER_NAME-* --format "{{.ID}}" | xargs docker rm -f