Skip to content

Commit 4e1b7cc

Browse files
committed
fix: update snapshot staging process to avoid symlink errors and improve git status visibility
1 parent 6626c88 commit 4e1b7cc

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

.github/workflows/update-snapshots.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,22 @@ jobs:
8080
- name: Run snapshot updates
8181
run: pnpm test:update
8282

83-
- name: Display git status (after test-update)
84-
run: git status
85-
8683
- name: Stage snapshot changes
87-
run: find packages \( -path '*/node_modules' -prune \) -o \( -path '*/__snapshots__/*' -o -path '*/snapshots/*' \) -print | xargs --no-run-if-empty git add --
84+
run: |
85+
# find does not follow symlinks by default, avoiding "beyond a symbolic link" git errors.
86+
# test-tag-name-transformer is excluded because its snapshots/ folder is listed in its .gitignore.
87+
find packages \( -path '*/node_modules' -o -path '*/test-tag-name-transformer' \) -prune \
88+
-o \( -path '*/__snapshots__/*' -o -path '*/snapshots/*' \) -print \
89+
| xargs --no-run-if-empty git add --
90+
91+
- name: Display git status
92+
run: git status
8893

8994
- name: Commit and push changes
9095
uses: stefanzweifel/git-auto-commit-action@v7
9196
with:
9297
commit_message: Update all snapshots
98+
# Disable internal git add so that only the files staged above are committed.
99+
file_pattern: ''
93100
commit_user_name: '${{ steps.app-token.outputs.app-slug }}[bot]'
94101
commit_user_email: '${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com'

packages/test-tag-name-transformer/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
"private": true,
44
"scripts": {
55
"prepare": "cpy \"../themes/default/snapshots\" ./ --dot",
6-
"test": "cross-env THEME_MODULE=theme ENABLE_TAG_NAME_TRANSFORMER=true kolibri-visual-test",
7-
"test:update:e2e": "cross-env THEME_MODULE=theme ENABLE_TAG_NAME_TRANSFORMER=true kolibri-visual-test --update-snapshots=changed theme-snapshots.spec.js"
6+
"test": "cross-env THEME_MODULE=theme ENABLE_TAG_NAME_TRANSFORMER=true kolibri-visual-test"
87
},
98
"devDependencies": {
109
"@public-ui/themes": "workspace:*",

0 commit comments

Comments
 (0)