Commit f486ae51e06 for woocommerce

commit f486ae51e06d416bfe37e93540e5b48002ad7034
Author: Vlad Olaru <vlad.olaru@automattic.com>
Date:   Mon Nov 2 19:12:09 2026 +0200

    [ci] Avoid downloading full Git history in PR performance tests (#70541)

    * ci: Skip redundant history fetches in PR Metrics

    PR Metrics already fetches the exact trunk baseline at depth one.
    Unshallowing later downloads history that the reached benchmark path
    does not need and cost about 50 seconds in the hosted experiments.

    Keep the existing unshallow for push runs, which compare against a
    fixed historical baseline. Both normal and unified-editor PR Metrics
    use this shared script.

    * ci: Hide the unused baseline fetch log group on PRs

    Keep the group markers with the push-only fetch so PR runs do not
    show an empty Checkout baseline section.

    * ci: Explain the push-only Metrics baseline fetch

diff --git a/.github/workflows/scripts/run-metrics.sh b/.github/workflows/scripts/run-metrics.sh
index 2ac166faf3b..231e0bc325a 100755
--- a/.github/workflows/scripts/run-metrics.sh
+++ b/.github/workflows/scripts/run-metrics.sh
@@ -63,9 +63,12 @@ if [ "$GITHUB_EVENT_NAME" == "push" ] || [ "$GITHUB_EVENT_NAME" == "pull_request
 	if test -n "$(find $ARTIFACTS_PATH -maxdepth 1 -name "*_${BASE_SHA}_*" -print -quit)"; then
 		title "Skipping benchmarking baseline as benchmarking results already available under $ARTIFACTS_PATH"
 	else
-		title "##[group]Checkout baseline"
-		git fetch --no-tags --quiet --unshallow origin trunk
-		echo '##[endgroup]'
+		# PRs already fetched their baseline above; push runs obtain the fixed older baseline here.
+		if [ "$GITHUB_EVENT_NAME" == "push" ]; then
+			title "##[group]Checkout baseline"
+			git fetch --no-tags --quiet --unshallow origin trunk
+			echo '##[endgroup]'
+		fi

 		title "##[group]Building baseline"
 		( git -c core.hooksPath=/dev/null checkout --quiet $BASE_SHA > /dev/null || git reset --hard $BASE_SHA ) && echo 'On' $(git rev-parse HEAD)