[GH-ISSUE #1561] failing to remove container #789

Closed
opened 2026-03-01 21:46:23 +03:00 by kerem · 6 comments
Owner

Originally created by @walksanatora on GitHub (Jan 14, 2023).
Original GitHub issue: https://github.com/nektos/act/issues/1561

Bug report info

act version:            0.2.35.r13.g767e6a86
GOOS:                   linux
GOARCH:                 amd64
NumCPU:                 4
Docker host:            DOCKER_HOST environment variable is unset/empty.
Sockets found:
	/var/run/docker.sock
Config files:           
	/home/walksanator/.actrc:
		-P ubuntu-latest=catthehacker/ubuntu:act-latest
		-P ubuntu-22.04=catthehacker/ubuntu:act-22.04
		-P ubuntu-20.04=catthehacker/ubuntu:act-20.04
		-P ubuntu-18.04=catthehacker/ubuntu:act-18.04
Build info:
	Go version:            go1.19.5
	Module path:           command-line-arguments
	Main version:          
	Main path:             
	Main checksum:         
	Build settings:
		-compiler:            gc
		-trimpath:            true
		CGO_ENABLED:          1
		GOARCH:               amd64
		GOOS:                 linux
		GOAMD64:              v1
Docker Engine:
	Engine version:        20.10.22
	Engine runtime:        runc
	Cgroup version:        2
	Cgroup driver:         systemd
	Storage driver:        overlay2
	Registry URI:          https://index.docker.io/v1/
	OS:                    Arch Linux
	OS type:               linux
	OS version:            
	OS arch:               x86_64
	OS kernel:             6.1.4-arch1-1
	OS CPU:                4
	OS memory:             19817 MB
	Security options:
		name=seccomp,profile=default
		name=cgroupns

Command used with act

act -j build-archives

Describe issue

when I run the action it runs then it just never stops
i then Ctrl+C it since it had been running for 30 minutes after the main.sh should have stopped (and the container exited)
but then it says

^C[build archives/build-archives] failed to remove container: Delete "http://%2Fvar%2Frun%2Fdocker.sock/v1.41/containers/489395a915a777c426c2f16a20e5b2cdbc15aa321c5a60bc4608f81043e235fc?force=1&v=1": context canceled
[build archives/build-archives]   ❌  Failure - Main run cc
[build archives/build-archives] Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.41/containers/adcea5d041c5b3cee3977419442e42750eb4f01290179a578f99c4aa946a89a8/archive?path=%2Fvar%2Frun%2Fact%2Fworkflow%2Fpathcmd.txt": context canceled
[build archives/build-archives] 🏁  Job succeeded
Error: context canceled

and when i try to run again I get

[build archives/build-archives] 🚀  Start image=catthehacker/ubuntu:act-latest
[build archives/build-archives]   🐳  docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=false
Error: Error response from daemon: remove act-build-archives-build-archives: volume is in use - [489395a915a777c426c2f16a20e5b2cdbc15aa321c5a60bc4608f81043e235fc

https://github.com/walksanatora/YC-client

Workflow content

name: "build archives"

on:
  workflow_dispatch:
  push:
    branches: [main]
    paths:
      - "src/**.lua"
      - "cc/**"

jobs:
  build-archives:
    runs-on: "ubuntu-latest"
    steps:
      - name: "checkout"
        uses: "actions/checkout@v3"
      - name: "run cc"
        uses: "walksanatora/craftos-action@v1.0.4"
        with:
          root: "cc"
          timeout: "60"
      - name: "upload-images"
        uses: "actions/upload-artifact@v3"
        with:
          name: "archives"
          path: "cc/computer/0/output/*"

Relevant log output

^CDEBU[0017] FIXME: Got an status-code for which error does not match any expected type!!!  error="Delete \"http://%2Fvar%2Frun%2Fdocker.sock/v1.41/containers/547d8247f2f76d11edcf485183db1aae6b02ced10e014764b8964b35dcb3ce55?force=1&v=1\": context canceled" module=api status_code=-1
[build archives/build-archives] failed to remove container: Delete "http://%2Fvar%2Frun%2Fdocker.sock/v1.41/containers/547d8247f2f76d11edcf485183db1aae6b02ced10e014764b8964b35dcb3ce55?force=1&v=1": context canceled
[build archives/build-archives] [DEBUG] Removed container: 547d8247f2f76d11edcf485183db1aae6b02ced10e014764b8964b35dcb3ce55
[build archives/build-archives]   ❌  Failure - Main run cc
DEBU[0017] FIXME: Got an status-code for which error does not match any expected type!!!  error="Get \"http://%2Fvar%2Frun%2Fdocker.sock/v1.41/containers/babe41a6e99481b6f445d259aefdee252519191045bb599917f608a84979048d/archive?path=%2Fvar%2Frun%2Fact%2Fworkflow%2Fstatecmd.txt\": context canceled" module=api status_code=-1
DEBU[0017] FIXME: Got an status-code for which error does not match any expected type!!!  error="Get \"http://%2Fvar%2Frun%2Fdocker.sock/v1.41/containers/babe41a6e99481b6f445d259aefdee252519191045bb599917f608a84979048d/archive?path=%2Fvar%2Frun%2Fact%2Fworkflow%2Foutputcmd.txt\": context canceled" module=api status_code=-1
DEBU[0017] FIXME: Got an status-code for which error does not match any expected type!!!  error="Get \"http://%2Fvar%2Frun%2Fdocker.sock/v1.41/containers/babe41a6e99481b6f445d259aefdee252519191045bb599917f608a84979048d/archive?path=%2Fvar%2Frun%2Fact%2Fworkflow%2Fpathcmd.txt\": context canceled" module=api status_code=-1
[build archives/build-archives] Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.41/containers/babe41a6e99481b6f445d259aefdee252519191045bb599917f608a84979048d/archive?path=%2Fvar%2Frun%2Fact%2Fworkflow%2Fpathcmd.txt": context canceled
[build archives/build-archives] [DEBUG] skipping post step for 'upload-images'; step was not executed
[build archives/build-archives] [DEBUG] skipping post step for 'checkout': no action model available
[build archives/build-archives] [DEBUG] Removed container: babe41a6e99481b6f445d259aefdee252519191045bb599917f608a84979048d
[build archives/build-archives] [DEBUG]   🐳  docker volume rm act-build-archives-build-archives
[build archives/build-archives] 🏁  Job succeeded
[build archives/build-archives] [DEBUG] Loading slug from git directory '/home/walksanator/.local/share/craftos-pc/computer/1/YC-client/.git'
[build archives/build-archives] [DEBUG] Loading revision from git directory '/home/walksanator/.local/share/craftos-pc/computer/1/YC-client/.git'
[build archives/build-archives] [DEBUG] Found revision: 8a83518d68569684b2fa2778f28d140c264abd4d
[build archives/build-archives] [DEBUG] HEAD points to '8a83518d68569684b2fa2778f28d140c264abd4d'
[build archives/build-archives] [DEBUG] using github ref: refs/heads/main
[build archives/build-archives] [DEBUG] Found revision: 8a83518d68569684b2fa2778f28d140c264abd4d
DEBU[0017] FIXME: Got an status-code for which error does not match any expected type!!!  error="Get \"http://%2Fvar%2Frun%2Fdocker.sock/v1.24/info\": context canceled" module=api status_code=-1
Error: context canceled

Additional information

No response

Originally created by @walksanatora on GitHub (Jan 14, 2023). Original GitHub issue: https://github.com/nektos/act/issues/1561 ### Bug report info ```plain text act version: 0.2.35.r13.g767e6a86 GOOS: linux GOARCH: amd64 NumCPU: 4 Docker host: DOCKER_HOST environment variable is unset/empty. Sockets found: /var/run/docker.sock Config files: /home/walksanator/.actrc: -P ubuntu-latest=catthehacker/ubuntu:act-latest -P ubuntu-22.04=catthehacker/ubuntu:act-22.04 -P ubuntu-20.04=catthehacker/ubuntu:act-20.04 -P ubuntu-18.04=catthehacker/ubuntu:act-18.04 Build info: Go version: go1.19.5 Module path: command-line-arguments Main version: Main path: Main checksum: Build settings: -compiler: gc -trimpath: true CGO_ENABLED: 1 GOARCH: amd64 GOOS: linux GOAMD64: v1 Docker Engine: Engine version: 20.10.22 Engine runtime: runc Cgroup version: 2 Cgroup driver: systemd Storage driver: overlay2 Registry URI: https://index.docker.io/v1/ OS: Arch Linux OS type: linux OS version: OS arch: x86_64 OS kernel: 6.1.4-arch1-1 OS CPU: 4 OS memory: 19817 MB Security options: name=seccomp,profile=default name=cgroupns ``` ### Command used with act ```sh act -j build-archives ``` ### Describe issue when I run the action it runs then it just never stops i then Ctrl+C it since it had been running for 30 minutes after the main.sh should have stopped (and the container exited) but then it says ``` ^C[build archives/build-archives] failed to remove container: Delete "http://%2Fvar%2Frun%2Fdocker.sock/v1.41/containers/489395a915a777c426c2f16a20e5b2cdbc15aa321c5a60bc4608f81043e235fc?force=1&v=1": context canceled [build archives/build-archives] ❌ Failure - Main run cc [build archives/build-archives] Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.41/containers/adcea5d041c5b3cee3977419442e42750eb4f01290179a578f99c4aa946a89a8/archive?path=%2Fvar%2Frun%2Fact%2Fworkflow%2Fpathcmd.txt": context canceled [build archives/build-archives] 🏁 Job succeeded Error: context canceled ``` and when i try to run again I get ``` [build archives/build-archives] 🚀 Start image=catthehacker/ubuntu:act-latest [build archives/build-archives] 🐳 docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=false Error: Error response from daemon: remove act-build-archives-build-archives: volume is in use - [489395a915a777c426c2f16a20e5b2cdbc15aa321c5a60bc4608f81043e235fc ``` ### Link to GitHub repository https://github.com/walksanatora/YC-client ### Workflow content ```yml name: "build archives" on: workflow_dispatch: push: branches: [main] paths: - "src/**.lua" - "cc/**" jobs: build-archives: runs-on: "ubuntu-latest" steps: - name: "checkout" uses: "actions/checkout@v3" - name: "run cc" uses: "walksanatora/craftos-action@v1.0.4" with: root: "cc" timeout: "60" - name: "upload-images" uses: "actions/upload-artifact@v3" with: name: "archives" path: "cc/computer/0/output/*" ``` ### Relevant log output ```sh ^CDEBU[0017] FIXME: Got an status-code for which error does not match any expected type!!! error="Delete \"http://%2Fvar%2Frun%2Fdocker.sock/v1.41/containers/547d8247f2f76d11edcf485183db1aae6b02ced10e014764b8964b35dcb3ce55?force=1&v=1\": context canceled" module=api status_code=-1 [build archives/build-archives] failed to remove container: Delete "http://%2Fvar%2Frun%2Fdocker.sock/v1.41/containers/547d8247f2f76d11edcf485183db1aae6b02ced10e014764b8964b35dcb3ce55?force=1&v=1": context canceled [build archives/build-archives] [DEBUG] Removed container: 547d8247f2f76d11edcf485183db1aae6b02ced10e014764b8964b35dcb3ce55 [build archives/build-archives] ❌ Failure - Main run cc DEBU[0017] FIXME: Got an status-code for which error does not match any expected type!!! error="Get \"http://%2Fvar%2Frun%2Fdocker.sock/v1.41/containers/babe41a6e99481b6f445d259aefdee252519191045bb599917f608a84979048d/archive?path=%2Fvar%2Frun%2Fact%2Fworkflow%2Fstatecmd.txt\": context canceled" module=api status_code=-1 DEBU[0017] FIXME: Got an status-code for which error does not match any expected type!!! error="Get \"http://%2Fvar%2Frun%2Fdocker.sock/v1.41/containers/babe41a6e99481b6f445d259aefdee252519191045bb599917f608a84979048d/archive?path=%2Fvar%2Frun%2Fact%2Fworkflow%2Foutputcmd.txt\": context canceled" module=api status_code=-1 DEBU[0017] FIXME: Got an status-code for which error does not match any expected type!!! error="Get \"http://%2Fvar%2Frun%2Fdocker.sock/v1.41/containers/babe41a6e99481b6f445d259aefdee252519191045bb599917f608a84979048d/archive?path=%2Fvar%2Frun%2Fact%2Fworkflow%2Fpathcmd.txt\": context canceled" module=api status_code=-1 [build archives/build-archives] Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.41/containers/babe41a6e99481b6f445d259aefdee252519191045bb599917f608a84979048d/archive?path=%2Fvar%2Frun%2Fact%2Fworkflow%2Fpathcmd.txt": context canceled [build archives/build-archives] [DEBUG] skipping post step for 'upload-images'; step was not executed [build archives/build-archives] [DEBUG] skipping post step for 'checkout': no action model available [build archives/build-archives] [DEBUG] Removed container: babe41a6e99481b6f445d259aefdee252519191045bb599917f608a84979048d [build archives/build-archives] [DEBUG] 🐳 docker volume rm act-build-archives-build-archives [build archives/build-archives] 🏁 Job succeeded [build archives/build-archives] [DEBUG] Loading slug from git directory '/home/walksanator/.local/share/craftos-pc/computer/1/YC-client/.git' [build archives/build-archives] [DEBUG] Loading revision from git directory '/home/walksanator/.local/share/craftos-pc/computer/1/YC-client/.git' [build archives/build-archives] [DEBUG] Found revision: 8a83518d68569684b2fa2778f28d140c264abd4d [build archives/build-archives] [DEBUG] HEAD points to '8a83518d68569684b2fa2778f28d140c264abd4d' [build archives/build-archives] [DEBUG] using github ref: refs/heads/main [build archives/build-archives] [DEBUG] Found revision: 8a83518d68569684b2fa2778f28d140c264abd4d DEBU[0017] FIXME: Got an status-code for which error does not match any expected type!!! error="Get \"http://%2Fvar%2Frun%2Fdocker.sock/v1.24/info\": context canceled" module=api status_code=-1 Error: context canceled ``` ### Additional information _No response_
kerem 2026-03-01 21:46:23 +03:00
Author
Owner

@walksanatora commented on GitHub (Jan 14, 2023):

also this may be out of scope for this issue
but also i tested with action i wrote and just had it upload-artifact the src dir
but that also errors out

<!-- gh-comment-id:1382669090 --> @walksanatora commented on GitHub (Jan 14, 2023): also this may be out of scope for this issue but also i tested with action i wrote and just had it upload-artifact the src dir but that also errors out
Author
Owner

@walksanatora commented on GitHub (Jan 14, 2023):

nvm had to add the argument

<!-- gh-comment-id:1382669245 --> @walksanatora commented on GitHub (Jan 14, 2023): nvm had to add the argument
Author
Owner

@github-actions[bot] commented on GitHub (Jul 14, 2023):

Issue is stale and will be closed in 14 days unless there is new activity

<!-- gh-comment-id:1635077998 --> @github-actions[bot] commented on GitHub (Jul 14, 2023): Issue is stale and will be closed in 14 days unless there is new activity
Author
Owner

@gladykov commented on GitHub (Dec 3, 2024):

@walksanatora Which argument you had to add?

<!-- gh-comment-id:2515092817 --> @gladykov commented on GitHub (Dec 3, 2024): @walksanatora Which argument you had to add?
Author
Owner

@Lupus commented on GitHub (May 21, 2025):

I'm also running into this issue it seems.

[Check/Check style] failed to remove container: Delete "http://localhost:2375/v1.43/containers/e58c0fb91470dd56922a699a2a43d190cf0d6df55b2ea1be4f966e0c6a15987e?force=1&v=1": context deadline exceeded
[Check/Check style] Error while stop job container: context deadline exceeded
<.....>
Error: Error occurred running finally: Error occurred running finally: context deadline exceeded (original error: <nil>) (original error: <nil>)
act version:            0.2.77
GOOS:                   linux
GOARCH:                 amd64
NumCPU:                 40
Docker host:            tcp://localhost:2375
Sockets found:
Config files:           
        /home/user/.config/act/actrc:
                -P ubuntu-latest=catthehacker/ubuntu:act-latest
                -P ubuntu-22.04=catthehacker/ubuntu:act-22.04
                -P ubuntu-20.04=catthehacker/ubuntu:act-20.04
                -P ubuntu-18.04=catthehacker/ubuntu:act-18.04
Build info:
        Go version:            go1.24.2
        Module path:           github.com/nektos/act
        Main version:          v0.2.77
        Main path:             github.com/nektos/act
        Main checksum:         
        Build settings:
                -buildmode:           exe
                -compiler:            gc
                -ldflags:             -s -w -X main.version=0.2.77 -X main.commit=d0136ae56885f4b5c9e25dd3f91f61e04bf7abbb -X main.date=2025-05-01T02:37:20Z -X main.builtBy=goreleaser
                CGO_ENABLED:          0
                GOARCH:               amd64
                GOOS:                 linux
                GOAMD64:              v1
                vcs:                  git
                vcs.revision:         d0136ae56885f4b5c9e25dd3f91f61e04bf7abbb
                vcs.time:             2025-05-01T02:36:57Z
                vcs.modified:         false
Docker Engine:
        Engine version:        24.0.7
        Engine runtime:        runc
        Cgroup version:        1
        Cgroup driver:         cgroupfs
        Storage driver:        overlay2
        Registry URI:          https://index.docker.io/v1/
        OS:                    Alpine Linux v3.18 (containerized)
        OS type:               linux
        OS version:            3.18.5
        OS arch:               x86_64
        OS kernel:             4.19.148nst
        OS CPU:                40
        OS memory:             128896 MB
        Security options:
                name=seccomp,profile=builtin

I was running this command:

act --no-cache-server --action-offline-mode -P ubuntu-latest=urm.nvidia.com/docker/catthehacker/ubuntu:rust-22.04 -j test --matrix toolchain:stable push

on this workflow:

name: Check

on:
  push:
    branches: [fork]

env:
  CARGO_TERM_COLOR: always

jobs:
  rustfmt:
    name: Check style
    runs-on: ubuntu-latest

    permissions:
      contents: read

    steps:
      - name: Checkout the code
        uses: actions/checkout@v4

      - name: Install toolchain
        run: |
          rustup toolchain install 1.87.0
          rustup default 1.87.0
          rustup component add rustfmt

      - name: Check style
        run: cargo fmt --all -- --check

  clippy:
    name: Run Clippy
    runs-on: ubuntu-latest

    permissions:
      contents: read

    steps:
      - name: Checkout the code
        uses: actions/checkout@v4

      - name: Install toolchain
        run: |
          rustup toolchain install 1.87.0
          rustup default 1.87.0
          rustup component add clippy

      - name: Setup Rust cache
        uses: Swatinem/rust-cache@v2

      - name: Run Clippy
        run: ./clippy.sh

  test:
    name: Run test suite with Rust ${{ matrix.toolchain }}
    needs: [rustfmt, clippy]
    runs-on: ubuntu-latest

    permissions:
      contents: read

    continue-on-error: "${{ matrix.toolchain == 'beta' || matrix.toolchain == 'nightly' }}"

    strategy:
      fail-fast: false # Continue other jobs if one fails to help filling the cache
      matrix:
        toolchain:
          - stable
          - beta
          - nightly

    steps:
      - name: Checkout the code
        uses: actions/checkout@v4

      - name: Install toolchain
        run: |
          rustup toolchain install ${{ matrix.toolchain }}
          rustup default ${{ matrix.toolchain }}

      - name: Setup Rust cache
        uses: Swatinem/rust-cache@v2

      - name: Setup OPA
        uses: open-policy-agent/setup-opa@v2
        with:
          version: latest

      - name: Build OPA bundles for test
        run: make build-opa

      - name: Test
        run: cargo test --all-features

  minimal-versions:
    name: Run test suite with minimal versions
    needs: [rustfmt, clippy]
    runs-on: ubuntu-latest

    permissions:
      contents: read

    steps:
      - name: Checkout the code
        uses: actions/checkout@v4

      - name: Install toolchain
        run: |
          rustup toolchain install 1.81.0 # MSRV
          rustup default 1.81.0 # MSRV

      - name: Setup Rust cache
        uses: Swatinem/rust-cache@v2

      - name: Setup OPA
        uses: open-policy-agent/setup-opa@v2
        with:
          version: latest

      - name: Build OPA bundles for test
        run: make build-opa

      - name: Install minimal versions
        env:
          RUSTC_BOOTSTRAP: "1"
        run: |
          cargo update -Z minimal-versions

      - name: Test
        run: cargo test --all-features --locked

  tests-done:
    name: Tests done
    if: ${{ always() }}
    needs:
      - rustfmt
      - clippy
      - test
      - minimal-versions
    runs-on: ubuntu-latest

    steps:
      - uses: matrix-org/done-action@v3
        with:
          needs: ${{ toJSON(needs) }}

<!-- gh-comment-id:2899049756 --> @Lupus commented on GitHub (May 21, 2025): I'm also running into this issue it seems. ``` [Check/Check style] failed to remove container: Delete "http://localhost:2375/v1.43/containers/e58c0fb91470dd56922a699a2a43d190cf0d6df55b2ea1be4f966e0c6a15987e?force=1&v=1": context deadline exceeded [Check/Check style] Error while stop job container: context deadline exceeded <.....> Error: Error occurred running finally: Error occurred running finally: context deadline exceeded (original error: <nil>) (original error: <nil>) ``` ``` act version: 0.2.77 GOOS: linux GOARCH: amd64 NumCPU: 40 Docker host: tcp://localhost:2375 Sockets found: Config files: /home/user/.config/act/actrc: -P ubuntu-latest=catthehacker/ubuntu:act-latest -P ubuntu-22.04=catthehacker/ubuntu:act-22.04 -P ubuntu-20.04=catthehacker/ubuntu:act-20.04 -P ubuntu-18.04=catthehacker/ubuntu:act-18.04 Build info: Go version: go1.24.2 Module path: github.com/nektos/act Main version: v0.2.77 Main path: github.com/nektos/act Main checksum: Build settings: -buildmode: exe -compiler: gc -ldflags: -s -w -X main.version=0.2.77 -X main.commit=d0136ae56885f4b5c9e25dd3f91f61e04bf7abbb -X main.date=2025-05-01T02:37:20Z -X main.builtBy=goreleaser CGO_ENABLED: 0 GOARCH: amd64 GOOS: linux GOAMD64: v1 vcs: git vcs.revision: d0136ae56885f4b5c9e25dd3f91f61e04bf7abbb vcs.time: 2025-05-01T02:36:57Z vcs.modified: false Docker Engine: Engine version: 24.0.7 Engine runtime: runc Cgroup version: 1 Cgroup driver: cgroupfs Storage driver: overlay2 Registry URI: https://index.docker.io/v1/ OS: Alpine Linux v3.18 (containerized) OS type: linux OS version: 3.18.5 OS arch: x86_64 OS kernel: 4.19.148nst OS CPU: 40 OS memory: 128896 MB Security options: name=seccomp,profile=builtin ``` I was running this command: ``` act --no-cache-server --action-offline-mode -P ubuntu-latest=urm.nvidia.com/docker/catthehacker/ubuntu:rust-22.04 -j test --matrix toolchain:stable push ``` on this workflow: ``` name: Check on: push: branches: [fork] env: CARGO_TERM_COLOR: always jobs: rustfmt: name: Check style runs-on: ubuntu-latest permissions: contents: read steps: - name: Checkout the code uses: actions/checkout@v4 - name: Install toolchain run: | rustup toolchain install 1.87.0 rustup default 1.87.0 rustup component add rustfmt - name: Check style run: cargo fmt --all -- --check clippy: name: Run Clippy runs-on: ubuntu-latest permissions: contents: read steps: - name: Checkout the code uses: actions/checkout@v4 - name: Install toolchain run: | rustup toolchain install 1.87.0 rustup default 1.87.0 rustup component add clippy - name: Setup Rust cache uses: Swatinem/rust-cache@v2 - name: Run Clippy run: ./clippy.sh test: name: Run test suite with Rust ${{ matrix.toolchain }} needs: [rustfmt, clippy] runs-on: ubuntu-latest permissions: contents: read continue-on-error: "${{ matrix.toolchain == 'beta' || matrix.toolchain == 'nightly' }}" strategy: fail-fast: false # Continue other jobs if one fails to help filling the cache matrix: toolchain: - stable - beta - nightly steps: - name: Checkout the code uses: actions/checkout@v4 - name: Install toolchain run: | rustup toolchain install ${{ matrix.toolchain }} rustup default ${{ matrix.toolchain }} - name: Setup Rust cache uses: Swatinem/rust-cache@v2 - name: Setup OPA uses: open-policy-agent/setup-opa@v2 with: version: latest - name: Build OPA bundles for test run: make build-opa - name: Test run: cargo test --all-features minimal-versions: name: Run test suite with minimal versions needs: [rustfmt, clippy] runs-on: ubuntu-latest permissions: contents: read steps: - name: Checkout the code uses: actions/checkout@v4 - name: Install toolchain run: | rustup toolchain install 1.81.0 # MSRV rustup default 1.81.0 # MSRV - name: Setup Rust cache uses: Swatinem/rust-cache@v2 - name: Setup OPA uses: open-policy-agent/setup-opa@v2 with: version: latest - name: Build OPA bundles for test run: make build-opa - name: Install minimal versions env: RUSTC_BOOTSTRAP: "1" run: | cargo update -Z minimal-versions - name: Test run: cargo test --all-features --locked tests-done: name: Tests done if: ${{ always() }} needs: - rustfmt - clippy - test - minimal-versions runs-on: ubuntu-latest steps: - uses: matrix-org/done-action@v3 with: needs: ${{ toJSON(needs) }} ```
Author
Owner

@felipemullen-fs commented on GitHub (Jun 25, 2025):

@gladykov

the answer you were looking for was

--rm                  automatically remove container(s)/volume(s) after a workflow(s) failure

using act --help

Run GitHub actions locally by specifying the event name (e.g. `push`) or an action name directly.

Usage:
  act [event name to run] [flags]

If no event name passed, will default to "on: push"
If actions handles only one event it will be used as default instead of "on: push"

Flags:
      --action-cache-path string                          Defines the path where the actions get cached and host workspaces created. (default "/Users/felipe/.cache/act")
      --action-offline-mode                               If action contents exists, it will not be fetch and pull again. If turn on this, will turn off force pull
  -a, --actor string                                      user that triggered the event (default "nektos/act")
      --artifact-server-addr string                       Defines the address to which the artifact server binds. (default "192.168.0.13")
      --artifact-server-path string                       Defines the path where the artifact server stores uploads and retrieves downloads from. If not specified the artifact server will not start.
      --artifact-server-port string                       Defines the port where the artifact server listens. (default "34567")
  -b, --bind                                              bind working directory to container, rather than copy
      --bug-report                                        Display system information for bug report
      --cache-server-addr string                          Defines the address to which the cache server binds. (default "192.168.0.13")
      --cache-server-external-url string                  Defines the external URL for if the cache server is behind a proxy. e.g.: https://act-cache-server.example.com. Be careful that there is no trailing slash.
      --cache-server-path string                          Defines the path where the cache server stores caches. (default "/Users/felipe/.cache/actcache")
      --cache-server-port uint16                          Defines the port where the artifact server listens. 0 means a randomly available port.
      --concurrent-jobs int                               Maximum number of concurrent jobs to run. Default is the number of CPUs available.
      --container-architecture string                     Architecture which should be used to run containers, e.g.: linux/amd64. If not specified, will use host default architecture. Requires Docker server API Version 1.41+. Ignored on earlier Docker server platforms.
      --container-cap-add stringArray                     kernel capabilities to add to the workflow containers (e.g. --container-cap-add SYS_PTRACE)
      --container-cap-drop stringArray                    kernel capabilities to remove from the workflow containers (e.g. --container-cap-drop SYS_PTRACE)
      --container-daemon-socket string                    URI to Docker Engine socket (e.g.: unix://~/.docker/run/docker.sock or - to disable bind mounting the socket)
      --container-options string                          Custom docker container options for the job container without an options property in the job definition
      --defaultbranch string                              the name of the main branch
      --detect-event                                      Use first event type from workflow as event that triggered the workflow
  -C, --directory string                                  working directory (default ".")
  -n, --dryrun                                            disable container creation, validates only workflow correctness
      --env stringArray                                   env to make available to actions with optional value (e.g. --env myenv=foo or --env myenv)
      --env-file string                                   environment file to read and use as env in the containers (default ".env")
  -e, --eventpath string                                  path to event JSON file
      --github-instance string                            GitHub instance to use. Only use this when using GitHub Enterprise Server. (default "github.com")
  -g, --graph                                             draw workflows
  -h, --help                                              help for act
      --input stringArray                                 action input to make available to actions (e.g. --input myinput=foo)
      --input-file string                                 input file to read and use as action input (default ".input")
      --insecure-secrets                                  NOT RECOMMENDED! Doesn't hide secrets while printing logs.
  -j, --job string                                        run a specific job ID
      --json                                              Output logs in json format
  -l, --list                                              list workflows
      --list-options                                      Print a json structure of compatible options
      --local-repository stringArray                      Replaces the specified repository and ref with a local folder (e.g. https://github.com/test/test@v0=/home/act/test or test/test@v0=/home/act/test, the latter matches any hosts or protocols)
      --log-prefix-job-id                                 Output the job id within non-json logs instead of the entire name
      --man-page                                          Print a generated manual page to stdout
      --matrix stringArray                                specify which matrix configuration to include (e.g. --matrix java:13
      --network string                                    Sets a docker network name. Defaults to host. (default "host")
      --no-cache-server                                   Disable cache server
      --no-recurse                                        Flag to disable running workflows from subdirectories of specified path in '--workflows'/'-W' flag
      --no-skip-checkout                                  Use actions/checkout instead of copying local files into container
  -P, --platform stringArray                              custom image to use per platform (e.g. -P ubuntu-18.04=nektos/act-environments-ubuntu:18.04)
      --privileged                                        use privileged mode
  -p, --pull                                              pull docker image(s) even if already present (default true)
  -q, --quiet                                             disable logging of output from steps
      --rebuild                                           rebuild local action docker image(s) even if already present (default true)
      --remote-name string                                git remote name that will be used to retrieve url of git repo (default "origin")
      --replace-ghe-action-token-with-github-com string   If you are using replace-ghe-action-with-github-com  and you want to use private actions on GitHub, you have to set personal access token
      --replace-ghe-action-with-github-com stringArray    If you are using GitHub Enterprise Server and allow specified actions from GitHub (github.com), you can set actions on this. (e.g. --replace-ghe-action-with-github-com =github/super-linter)
  -r, --reuse                                             don't remove container(s) on successfully completed workflow(s) to maintain state between runs
      --rm                                                automatically remove container(s)/volume(s) after a workflow(s) failure
  -s, --secret stringArray                                secret to make available to actions with optional value (e.g. -s mysecret=foo or -s mysecret)
      --secret-file string                                file with list of secrets to read from (e.g. --secret-file .secrets) (default ".secrets")
      --use-gitignore                                     Controls whether paths specified in .gitignore should be copied into container (default true)
      --use-new-action-cache                              Enable using the new Action Cache for storing Actions locally
      --userns string                                     user namespace to use
      --var stringArray                                   variable to make available to actions with optional value (e.g. --var myvar=foo or --var myvar)
      --var-file string                                   file with list of vars to read from (e.g. --var-file .vars) (default ".vars")
  -v, --verbose                                           verbose output
      --version                                           version for act
  -w, --watch                                             watch the contents of the local repo and run when files change
  -W, --workflows string                                  path to workflow file(s) (default "./.github/workflows/")
<!-- gh-comment-id:3005748449 --> @felipemullen-fs commented on GitHub (Jun 25, 2025): @gladykov the answer you were looking for was ```bash --rm automatically remove container(s)/volume(s) after a workflow(s) failure ``` using act --help ```bash Run GitHub actions locally by specifying the event name (e.g. `push`) or an action name directly. Usage: act [event name to run] [flags] If no event name passed, will default to "on: push" If actions handles only one event it will be used as default instead of "on: push" Flags: --action-cache-path string Defines the path where the actions get cached and host workspaces created. (default "/Users/felipe/.cache/act") --action-offline-mode If action contents exists, it will not be fetch and pull again. If turn on this, will turn off force pull -a, --actor string user that triggered the event (default "nektos/act") --artifact-server-addr string Defines the address to which the artifact server binds. (default "192.168.0.13") --artifact-server-path string Defines the path where the artifact server stores uploads and retrieves downloads from. If not specified the artifact server will not start. --artifact-server-port string Defines the port where the artifact server listens. (default "34567") -b, --bind bind working directory to container, rather than copy --bug-report Display system information for bug report --cache-server-addr string Defines the address to which the cache server binds. (default "192.168.0.13") --cache-server-external-url string Defines the external URL for if the cache server is behind a proxy. e.g.: https://act-cache-server.example.com. Be careful that there is no trailing slash. --cache-server-path string Defines the path where the cache server stores caches. (default "/Users/felipe/.cache/actcache") --cache-server-port uint16 Defines the port where the artifact server listens. 0 means a randomly available port. --concurrent-jobs int Maximum number of concurrent jobs to run. Default is the number of CPUs available. --container-architecture string Architecture which should be used to run containers, e.g.: linux/amd64. If not specified, will use host default architecture. Requires Docker server API Version 1.41+. Ignored on earlier Docker server platforms. --container-cap-add stringArray kernel capabilities to add to the workflow containers (e.g. --container-cap-add SYS_PTRACE) --container-cap-drop stringArray kernel capabilities to remove from the workflow containers (e.g. --container-cap-drop SYS_PTRACE) --container-daemon-socket string URI to Docker Engine socket (e.g.: unix://~/.docker/run/docker.sock or - to disable bind mounting the socket) --container-options string Custom docker container options for the job container without an options property in the job definition --defaultbranch string the name of the main branch --detect-event Use first event type from workflow as event that triggered the workflow -C, --directory string working directory (default ".") -n, --dryrun disable container creation, validates only workflow correctness --env stringArray env to make available to actions with optional value (e.g. --env myenv=foo or --env myenv) --env-file string environment file to read and use as env in the containers (default ".env") -e, --eventpath string path to event JSON file --github-instance string GitHub instance to use. Only use this when using GitHub Enterprise Server. (default "github.com") -g, --graph draw workflows -h, --help help for act --input stringArray action input to make available to actions (e.g. --input myinput=foo) --input-file string input file to read and use as action input (default ".input") --insecure-secrets NOT RECOMMENDED! Doesn't hide secrets while printing logs. -j, --job string run a specific job ID --json Output logs in json format -l, --list list workflows --list-options Print a json structure of compatible options --local-repository stringArray Replaces the specified repository and ref with a local folder (e.g. https://github.com/test/test@v0=/home/act/test or test/test@v0=/home/act/test, the latter matches any hosts or protocols) --log-prefix-job-id Output the job id within non-json logs instead of the entire name --man-page Print a generated manual page to stdout --matrix stringArray specify which matrix configuration to include (e.g. --matrix java:13 --network string Sets a docker network name. Defaults to host. (default "host") --no-cache-server Disable cache server --no-recurse Flag to disable running workflows from subdirectories of specified path in '--workflows'/'-W' flag --no-skip-checkout Use actions/checkout instead of copying local files into container -P, --platform stringArray custom image to use per platform (e.g. -P ubuntu-18.04=nektos/act-environments-ubuntu:18.04) --privileged use privileged mode -p, --pull pull docker image(s) even if already present (default true) -q, --quiet disable logging of output from steps --rebuild rebuild local action docker image(s) even if already present (default true) --remote-name string git remote name that will be used to retrieve url of git repo (default "origin") --replace-ghe-action-token-with-github-com string If you are using replace-ghe-action-with-github-com and you want to use private actions on GitHub, you have to set personal access token --replace-ghe-action-with-github-com stringArray If you are using GitHub Enterprise Server and allow specified actions from GitHub (github.com), you can set actions on this. (e.g. --replace-ghe-action-with-github-com =github/super-linter) -r, --reuse don't remove container(s) on successfully completed workflow(s) to maintain state between runs --rm automatically remove container(s)/volume(s) after a workflow(s) failure -s, --secret stringArray secret to make available to actions with optional value (e.g. -s mysecret=foo or -s mysecret) --secret-file string file with list of secrets to read from (e.g. --secret-file .secrets) (default ".secrets") --use-gitignore Controls whether paths specified in .gitignore should be copied into container (default true) --use-new-action-cache Enable using the new Action Cache for storing Actions locally --userns string user namespace to use --var stringArray variable to make available to actions with optional value (e.g. --var myvar=foo or --var myvar) --var-file string file with list of vars to read from (e.g. --var-file .vars) (default ".vars") -v, --verbose verbose output --version version for act -w, --watch watch the contents of the local repo and run when files change -W, --workflows string path to workflow file(s) (default "./.github/workflows/") ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/act#789
No description provided.