From 1b384b63af2eb939483428a1bc8418e8b66157c7 Mon Sep 17 00:00:00 2001 From: Kumar Challa Date: Tue, 6 Jan 2026 10:06:13 -0600 Subject: [PATCH 1/3] fix: apply workflow fixes to build-and-release.yml - Add workspace cleanup step to fix permission issues - Add directory existence check in cache move step - Same fixes applied to snd.yml earlier --- .github/workflows/build-and-release.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index 64c0cb6..308b627 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -35,6 +35,12 @@ jobs: release_type: ${{ steps.version.outputs.release_type }} docker_tag: ${{ steps.docker_tags.outputs.tag }} steps: + - name: Clean workspace + if: always() + run: | + sudo chown -R $USER:$USER ${{ github.workspace }} || true + rm -rf ${{ github.workspace }}/* ${{ github.workspace }}/.* 2>/dev/null || true + - name: Checkout repository uses: actions/checkout@v4 with: @@ -145,6 +151,12 @@ jobs: platform: linux/arm64 platform_tag: arm64 steps: + - name: Clean workspace + if: always() + run: | + sudo chown -R $USER:$USER ${{ github.workspace }} || true + rm -rf ${{ github.workspace }}/* ${{ github.workspace }}/.* 2>/dev/null || true + - name: Checkout repository uses: actions/checkout@v4 with: @@ -192,7 +204,9 @@ jobs: if: always() run: | rm -rf ${{ env.CACHE_PATH }} - mv ${{ env.CACHE_PATH_NEW }} ${{ env.CACHE_PATH }} + if [ -d "${{ env.CACHE_PATH_NEW }}" ]; then + mv ${{ env.CACHE_PATH_NEW }} ${{ env.CACHE_PATH }} + fi merge: name: Merge Multi-Arch Image @@ -585,4 +599,4 @@ jobs: body: newBody }); - console.log(`✅ Updated PR #${context.issue.number}`); \ No newline at end of file + console.log(`✅ Updated PR #${context.issue.number}`); From 249fc8ba24bc6d14d6cc152fce9568cfe9d5aca5 Mon Sep 17 00:00:00 2001 From: Kumar Challa Date: Tue, 6 Jan 2026 10:14:30 -0600 Subject: [PATCH 2/3] fix: prevent workspace cleanup during checkout in build workflows --- .github/workflows/build-and-release.yml | 6 ++++++ .github/workflows/snd.yml | 1 + 2 files changed, 7 insertions(+) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index 308b627..b3cac5f 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -45,6 +45,7 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 + clean: false - name: Determine Docker tags and cache id: docker_tags @@ -161,6 +162,7 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 + clean: false - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -243,6 +245,8 @@ jobs: - name: Checkout repository if: github.ref == 'refs/heads/main' uses: actions/checkout@v4 + with: + clean: false - name: Docker Hub Description if: github.ref == 'refs/heads/main' @@ -266,6 +270,7 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 + clean: false - name: Generate commit history id: changelog @@ -364,6 +369,7 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 + clean: false - name: Collect commit information id: collect diff --git a/.github/workflows/snd.yml b/.github/workflows/snd.yml index 229253f..d4cc18a 100644 --- a/.github/workflows/snd.yml +++ b/.github/workflows/snd.yml @@ -33,6 +33,7 @@ jobs: uses: actions/checkout@v4 with: ref: snd + clean: false - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 From 2913852ec4fb78d9ecf9f8f0ab163af2ff8a4aa5 Mon Sep 17 00:00:00 2001 From: Kumar Challa Date: Tue, 6 Jan 2026 10:20:24 -0600 Subject: [PATCH 3/3] fix: use sudo for workspace cleanup in build workflows --- .github/workflows/build-and-release.yml | 4 ++-- .github/workflows/snd.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index b3cac5f..555bcb5 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -39,7 +39,7 @@ jobs: if: always() run: | sudo chown -R $USER:$USER ${{ github.workspace }} || true - rm -rf ${{ github.workspace }}/* ${{ github.workspace }}/.* 2>/dev/null || true + sudo rm -rf ${{ github.workspace }}/* ${{ github.workspace }}/.* 2>/dev/null || true - name: Checkout repository uses: actions/checkout@v4 @@ -156,7 +156,7 @@ jobs: if: always() run: | sudo chown -R $USER:$USER ${{ github.workspace }} || true - rm -rf ${{ github.workspace }}/* ${{ github.workspace }}/.* 2>/dev/null || true + sudo rm -rf ${{ github.workspace }}/* ${{ github.workspace }}/.* 2>/dev/null || true - name: Checkout repository uses: actions/checkout@v4 diff --git a/.github/workflows/snd.yml b/.github/workflows/snd.yml index d4cc18a..fdb1174 100644 --- a/.github/workflows/snd.yml +++ b/.github/workflows/snd.yml @@ -27,7 +27,7 @@ jobs: if: always() run: | sudo chown -R $USER:$USER ${{ github.workspace }} || true - rm -rf ${{ github.workspace }}/* ${{ github.workspace }}/.* 2>/dev/null || true + sudo rm -rf ${{ github.workspace }}/* ${{ github.workspace }}/.* 2>/dev/null || true - name: Checkout repository uses: actions/checkout@v4