Skip to content

Commit 13518be

Browse files
committed
fix: fix reanme source & dest variable
1 parent 04eb2a8 commit 13518be

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

.github/workflows/update-en-docs.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,17 @@ jobs:
9999
# For each renamed file
100100
echo "$RENAMES" | while read -r LINE; do
101101
# Split the line into source and destination
102-
SOURCE=$(echo "$LINE" | awk '{print $1}')
103-
DEST=$(echo "$LINE" | awk '{print $2}')
102+
# After sed processing, each LINE is in format: "oldname -> newname"
103+
SOURCE=$(echo "$LINE" | awk -F ' -> ' '{print $1}')
104+
DEST=$(echo "$LINE" | awk -F ' -> ' '{print $2}')
104105
105106
# Check if there are actual content changes using git diff with -M (detect renames)
106107
# If there's output from the diff command beyond the rename header, there are content changes
107108
DIFF_OUTPUT=$(git diff --cached -M -- "$SOURCE" "$DEST")
108109
# Count lines that start with +/- (changes) but ignore the rename header lines
109110
CHANGE_COUNT=$(echo "$DIFF_OUTPUT" | grep -v "^renamed:" | grep -v "^─" | grep -E "^\+|^-" | wc -l)
110111
111-
echo "Git diff for $SOURCE → $DEST: $CHANGE_COUNT lines changed"
112+
echo "Git diff for '$SOURCE''$DEST': $CHANGE_COUNT lines changed"
112113
113114
# Determine if this is just a rename or if content was also changed
114115
if [ "$CHANGE_COUNT" -eq 0 ]; then

0 commit comments

Comments
 (0)