Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(ci): clean frontend/dist before base build in dist-size comparison (#68913)

Thomas Obermüllerd7553ee2d8d6
diff --git a/.github/workflows/ci-frontend.yml b/.github/workflows/ci-frontend.yml
index ee5459cbbfc2..48d535059f46 100644
--- a/.github/workflows/ci-frontend.yml
+++ b/.github/workflows/ci-frontend.yml
@@ -417,6 +417,11 @@ jobs:
run: |
git fetch -n origin "$BASE_SHA"
git reset --hard "$BASE_SHA"
+ # dist/ is untracked so it survives the reset. Without a clean, the base
+ # build layers differently-hashed chunks on top of the PR's, inflating the
+ # base measurement by hundreds of MiB and making every PR's dist-size delta
+ # a large spurious negative. The build never cleans dist/ itself.
+ rm -rf frontend/dist
pnpm --filter=@posthog/frontend... install
pnpm --filter=@posthog/frontend build:with-report
du -sb frontend/dist | cut -f1 > frontend/dist-size-base.txt