From d8409f1e353efe0e92e6ad2f150906273a553137 Mon Sep 17 00:00:00 2001 From: ad-claw000 Date: Tue, 21 Apr 2026 15:45:48 +0000 Subject: [PATCH] fix: cleanup previous runner state properly to avoid permission denied errors in self-hosted runners --- .github/workflows/checks.yml | 4 ++++ .github/workflows/dependencies.yml | 4 ++++ .github/workflows/develop.yml | 8 ++++++++ .github/workflows/main.yml | 16 ++++++++++++++++ .github/workflows/pr.yaml | 4 ++++ .github/workflows/release.yaml | 8 ++++++++ 6 files changed, 44 insertions(+) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index fcaf731b..46a5da67 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -12,6 +12,10 @@ jobs: runs-on: ubuntu-latest steps: + - name: Cleanup previous run + run: docker run --rm -v ${{ github.workspace }}:/workspace alpine sh -c "rm -rf /workspace/test/aperturedb/db* /workspace/test/aperturedb/logs" || true + continue-on-error: true + - uses: actions/checkout@v3 - uses: actions/setup-python@v3 diff --git a/.github/workflows/dependencies.yml b/.github/workflows/dependencies.yml index dc66e4ee..789b73ea 100644 --- a/.github/workflows/dependencies.yml +++ b/.github/workflows/dependencies.yml @@ -13,6 +13,10 @@ jobs: steps: + - name: Cleanup previous run + run: docker run --rm -v ${{ github.workspace }}:/workspace alpine sh -c "rm -rf /workspace/test/aperturedb/db* /workspace/test/aperturedb/logs" || true + continue-on-error: true + - uses: actions/checkout@v3 - name: Login to DockerHub diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index cae2c7fe..71f5e45f 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -13,6 +13,10 @@ jobs: steps: + - name: Cleanup previous run + run: docker run --rm -v ${{ github.workspace }}:/workspace alpine sh -c "rm -rf /workspace/test/aperturedb/db* /workspace/test/aperturedb/logs" || true + continue-on-error: true + - uses: actions/checkout@v3 - name: Login to DockerHub @@ -46,6 +50,10 @@ jobs: steps: + - name: Cleanup previous run + run: docker run --rm -v ${{ github.workspace }}:/workspace alpine sh -c "rm -rf /workspace/test/aperturedb/db* /workspace/test/aperturedb/logs" || true + continue-on-error: true + - uses: actions/checkout@v3 - name: Login to DockerHub diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 55ed1f1a..af5452fd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,6 +13,10 @@ jobs: steps: + - name: Cleanup previous run + run: docker run --rm -v ${{ github.workspace }}:/workspace alpine sh -c "rm -rf /workspace/test/aperturedb/db* /workspace/test/aperturedb/logs" || true + continue-on-error: true + - uses: actions/checkout@v3 - name: Login to DockerHub @@ -46,6 +50,10 @@ jobs: steps: + - name: Cleanup previous run + run: docker run --rm -v ${{ github.workspace }}:/workspace alpine sh -c "rm -rf /workspace/test/aperturedb/db* /workspace/test/aperturedb/logs" || true + continue-on-error: true + - uses: actions/checkout@v3 - name: Login to DockerHub @@ -87,6 +95,10 @@ jobs: needs: - build_notebooks_and_publish_pypi steps: + - name: Cleanup previous run + run: docker run --rm -v ${{ github.workspace }}:/workspace alpine sh -c "rm -rf /workspace/test/aperturedb/db* /workspace/test/aperturedb/logs" || true + continue-on-error: true + - uses: actions/checkout@v3 - name: repository dispatch run: | @@ -103,6 +115,10 @@ jobs: needs: - build_notebooks_and_publish_pypi steps: + - name: Cleanup previous run + run: docker run --rm -v ${{ github.workspace }}:/workspace alpine sh -c "rm -rf /workspace/test/aperturedb/db* /workspace/test/aperturedb/logs" || true + continue-on-error: true + - uses: actions/checkout@v3 - name: repository dispatch run: | diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 1310bd27..8bf0cae9 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -13,6 +13,10 @@ jobs: steps: + - name: Cleanup previous run + run: docker run --rm -v ${{ github.workspace }}:/workspace alpine sh -c "rm -rf /workspace/test/aperturedb/db* /workspace/test/aperturedb/logs" || true + continue-on-error: true + - uses: actions/checkout@v3 - name: Login to DockerHub diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index ea9097b6..41c1d4ca 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -14,6 +14,10 @@ jobs: steps: + - name: Cleanup previous run + run: docker run --rm -v ${{ github.workspace }}:/workspace alpine sh -c "rm -rf /workspace/test/aperturedb/db* /workspace/test/aperturedb/logs" || true + continue-on-error: true + - uses: actions/checkout@v3 - name: Login to DockerHub @@ -46,6 +50,10 @@ jobs: steps: + - name: Cleanup previous run + run: docker run --rm -v ${{ github.workspace }}:/workspace alpine sh -c "rm -rf /workspace/test/aperturedb/db* /workspace/test/aperturedb/logs" || true + continue-on-error: true + - uses: actions/checkout@v3 - name: Login to DockerHub