Skip to content

Commit a72073f

Browse files
committed
fix
1 parent ba87337 commit a72073f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

.github/workflows/add-redirects.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,12 @@ jobs:
8383
old="${old%.txt}"
8484
8585
redirect='${prefix}/${version}'"$old"'/ -> ${base}/${version}/'
86-
87-
# if redirect not already in file, add to string to add to PR description
86+
87+
# escape special characters before searching for string
8888
escaped_redirect=$(printf '%s\n' "$redirect" | sed 's/[[*${}|\\]/\\&/g')
89-
if ! grep -qE "${escaped_redirect}$" "$REDIRECTS_FILE"; then
89+
90+
# if redirect not already in file, add to string to add to PR description
91+
if ! grep -qE "${escaped_redirect}$" $REDIRECTS_FILE; then
9092
deleted_redirects+="<li>[&lt;v&gt;-*]: $redirect</li>"
9193
fi
9294
done

0 commit comments

Comments
 (0)