Fix CI: use git reset --hard for reliable base commit restore

The previous approach using git reset HEAD~ followed by git restore .
wasn't reliably restoring the package.json to the base commit state,
causing "Command not found" errors when trying to run
generate-webpack-stats-file.

Using --hard ensures all tracked files are forcefully reset to the
base commit state. Also added --force to yarn install to ensure a
clean reinstall after the reset.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Samuel Newman
2026-01-10 16:41:06 +02:00
parent 791d903d16
commit c646840654
2 changed files with 2 additions and 8 deletions
+2 -3
View File
@@ -74,13 +74,12 @@ jobs:
- name: Restore to base commit
if: ${{ !steps.get-base-stats.outputs.cache-hit }}
run: |
git reset HEAD~
git restore .
git reset --hard HEAD~
- name: 🔦 Generate stats file from base commit
if: ${{ !steps.get-base-stats.outputs.cache-hit }}
run: |
yarn install
yarn install --force
yarn intl:build
yarn generate-webpack-stats-file
mv stats.json stats-base.json