diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index 64c0cb6..555bcb5 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -35,10 +35,17 @@ 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 + sudo rm -rf ${{ github.workspace }}/* ${{ github.workspace }}/.* 2>/dev/null || true + - name: Checkout repository uses: actions/checkout@v4 with: fetch-depth: 0 + clean: false - name: Determine Docker tags and cache id: docker_tags @@ -145,10 +152,17 @@ jobs: platform: linux/arm64 platform_tag: arm64 steps: + - name: Clean workspace + if: always() + run: | + sudo chown -R $USER:$USER ${{ github.workspace }} || true + sudo rm -rf ${{ github.workspace }}/* ${{ github.workspace }}/.* 2>/dev/null || true + - name: Checkout repository uses: actions/checkout@v4 with: fetch-depth: 0 + clean: false - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -192,7 +206,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 @@ -229,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' @@ -252,6 +270,7 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 + clean: false - name: Generate commit history id: changelog @@ -350,6 +369,7 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 + clean: false - name: Collect commit information id: collect @@ -585,4 +605,4 @@ jobs: body: newBody }); - console.log(`✅ Updated PR #${context.issue.number}`); \ No newline at end of file + console.log(`✅ Updated PR #${context.issue.number}`); diff --git a/.github/workflows/snd.yml b/.github/workflows/snd.yml index 229253f..fdb1174 100644 --- a/.github/workflows/snd.yml +++ b/.github/workflows/snd.yml @@ -27,12 +27,13 @@ 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 with: ref: snd + clean: false - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3