File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change 51
51
$FILES_URL \
52
52
| jq -r --arg prefix $BRANCH_NAME/ '.[] | select(((.filename | test("content\/.+\\.md")) and .status != "removed")) | ($prefix + .filename)' \
53
53
| sed -E -e 's|(^[^/]+/)([^/]+/)|\1|' -e 's|^|https://redis.io/docs/staging/|' -e 's|(_?index)?\.md||' \
54
- | uniq \
55
- | xargs \
56
- | sed 's/ /<br>/g')
54
+ | sort \
55
+ | uniq)
57
56
58
57
# Get all changed image files
59
58
CHANGED_IMAGE_FILES=$(curl -Ls \
@@ -70,14 +69,19 @@ jobs:
70
69
for CHANGED_IMAGE_FILE in $CHANGED_IMAGE_FILES; do
71
70
MD_FILE_WITH_IMAGE=$(grep -ro "$CHANGED_IMAGE_FILE" content \
72
71
| sed -E -e 's|:.+||' -e "s|^content/|https://redis.io/docs/staging/$BRANCH_NAME/|" -e 's|(_?index)?\.md||' \
72
+ | sort \
73
73
| uniq)
74
74
MD_FILES_WITH_IMAGE+=($MD_FILE_WITH_IMAGE)
75
75
done
76
- CHANGED_MD_FILES_WITH_IMAGE=$(printf "%s\n" "${MD_FILES_WITH_IMAGE[@]}" \
76
+ CHANGED_MD_FILES=$(printf "%s\n" "${CHANGED_MD_FILES}" "${MD_FILES_WITH_IMAGE[@]}" \
77
+ | sort \
77
78
| uniq \
78
79
| xargs \
79
80
| sed 's/ /<br>/g')
80
- CHANGED_MD_FILES="${CHANGED_MD_FILES}<br>${CHANGED_MD_FILES_WITH_IMAGE}"
81
+ else
82
+ CHANGED_MD_FILES=$(printf "%s\n" "${CHANGED_MD_FILES}" \
83
+ | xargs \
84
+ | sed 's/ /<br>/g')
81
85
fi
82
86
83
87
if [[ -z "$CHANGED_MD_FILES" ]]
You can’t perform that action at this time.
0 commit comments