From 546791e90ba903373b25dfae73ac9b5c56779f9e Mon Sep 17 00:00:00 2001 From: Sped0n Date: Wed, 4 Feb 2026 04:22:40 +0800 Subject: [PATCH] ci: add pre-build cleanup step for artifact updates Add a cleanup step to remove the bundled directory before building when running the latest Hugo version on push or merged PR events. This ensures old or unused JavaScript files are not included in the updated artifacts. Signed-off-by: Sped0n --- .github/workflows/build.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c28ef44..6468bb1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -64,10 +64,16 @@ jobs: - name: Install project dependencies run: 'pnpm install' + - name: Pre-build cleanup + if: > + matrix.hugo-version == 'latest' && + (github.event_name == 'push' || github.event.pull_request.merged == true) + run: 'rm -rf bundled' + - name: Build run: 'pnpm run build' - - name: Commit + - name: Push artifacts if: > matrix.hugo-version == 'latest' && (github.event_name == 'push' || github.event.pull_request.merged == true)