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:
@@ -74,13 +74,12 @@ jobs:
|
|||||||
- name: Restore to base commit
|
- name: Restore to base commit
|
||||||
if: ${{ !steps.get-base-stats.outputs.cache-hit }}
|
if: ${{ !steps.get-base-stats.outputs.cache-hit }}
|
||||||
run: |
|
run: |
|
||||||
git reset HEAD~
|
git reset --hard HEAD~
|
||||||
git restore .
|
|
||||||
|
|
||||||
- name: 🔦 Generate stats file from base commit
|
- name: 🔦 Generate stats file from base commit
|
||||||
if: ${{ !steps.get-base-stats.outputs.cache-hit }}
|
if: ${{ !steps.get-base-stats.outputs.cache-hit }}
|
||||||
run: |
|
run: |
|
||||||
yarn install
|
yarn install --force
|
||||||
yarn intl:build
|
yarn intl:build
|
||||||
yarn generate-webpack-stats-file
|
yarn generate-webpack-stats-file
|
||||||
mv stats.json stats-base.json
|
mv stats.json stats-base.json
|
||||||
|
|||||||
@@ -71,9 +71,6 @@ artifacts
|
|||||||
# Expo
|
# Expo
|
||||||
.expo/
|
.expo/
|
||||||
dist/
|
dist/
|
||||||
|
|
||||||
# Rsbuild
|
|
||||||
.rsbuild/
|
|
||||||
*.jks
|
*.jks
|
||||||
*.p8
|
*.p8
|
||||||
*.p12
|
*.p12
|
||||||
@@ -124,9 +121,7 @@ src/locale/locales/**/*.js
|
|||||||
bskyogcard/src/assets/fonts/noto-*
|
bskyogcard/src/assets/fonts/noto-*
|
||||||
|
|
||||||
# bskyweb build output
|
# bskyweb build output
|
||||||
bskyweb/static/js/
|
|
||||||
bskyweb/static/media/*.webp
|
bskyweb/static/media/*.webp
|
||||||
bskyweb/static/media/*.jpg
|
bskyweb/static/media/*.jpg
|
||||||
bskyweb/static/media/*.png
|
bskyweb/static/media/*.png
|
||||||
bskyweb/static/media/*.svg
|
bskyweb/static/media/*.svg
|
||||||
bskyweb/static/media/*.woff2
|
|
||||||
|
|||||||
Reference in New Issue
Block a user