Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitadb5d7b

Browse files
mmosarafO2bjp232004
authored andcommitted
fix: handle force push/rebase in translation detection
1 parent01c203f commitadb5d7b

File tree

1 file changed

+21
-7
lines changed

1 file changed

+21
-7
lines changed

‎.github/workflows/update-translations.yml‎

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,27 @@ jobs:
5757
5858
# Method 1: Check using git diff with before/after SHAs
5959
if [ "${{ github.event.before }}" != "" ] && [ "${{ github.event.before }}" != "0000000000000000000000000000000000000000" ]; then
60-
echo "Comparing ${{ github.event.before }} with ${{ github.sha }}"
61-
CHANGED_FILES=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }})
62-
echo "Changed files in this push:"
63-
echo "$CHANGED_FILES"
64-
65-
if echo "$CHANGED_FILES" | grep -q "web/src/locales/languages/en.json"; then
66-
EN_JSON_CHANGED=true
60+
echo "Attempting to compare ${{ github.event.before }} with ${{ github.sha }}"
61+
62+
# Check if before commit exists (handles force push/rebase)
63+
if git cat-file -e ${{ github.event.before }} 2>/dev/null; then
64+
echo "Before commit exists, comparing..."
65+
CHANGED_FILES=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }})
66+
echo "Changed files in this push:"
67+
echo "$CHANGED_FILES"
68+
69+
if echo "$CHANGED_FILES" | grep -q "web/src/locales/languages/en.json"; then
70+
EN_JSON_CHANGED=true
71+
fi
72+
else
73+
echo "⚠️ Before commit doesn't exist (force push/rebase), checking last commit..."
74+
CHANGED_FILES=$(git show --name-only --pretty="" HEAD)
75+
echo "Changed files in last commit:"
76+
echo "$CHANGED_FILES"
77+
78+
if echo "$CHANGED_FILES" | grep -q "web/src/locales/languages/en.json"; then
79+
EN_JSON_CHANGED=true
80+
fi
6781
fi
6882
else
6983
# Method 2: For first push or workflow_dispatch, check last commit

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp