File tree Expand file tree Collapse file tree 1 file changed +12
-15
lines changed
Expand file tree Collapse file tree 1 file changed +12
-15
lines changed Original file line number Diff line number Diff line change @@ -312,24 +312,21 @@ jobs:
312312 PREV_URL=$(echo "$PREV_VERSIONS" | jq -r --arg key "$KEY" '.[$key].url // empty')
313313 PREV_COUNT=$(echo "$PREV_VERSIONS" | jq -r --arg key "$KEY" '.[$key].count // 0')
314314
315- # Security: Use unquoted heredoc for direct variable expansion (safer than sed)
315+ # Build markdown using printf (safer than sed, avoids injection )
316316 if [ -n "$PREV_URL" ] && [ "$PREV_URL" != "null" ]; then
317317 NEW_COUNT=$((PREV_COUNT + 1))
318- cat >> plot_markdown.txt << PLOTEOF
319- # ## ${LIBRARY} (${VARIANT}) - UPDATE
320-
321- | Before | After |
322- |--------|-------|
323- |  |  |
324-
325- [View version history (${NEW_COUNT} versions)](${HISTORY_URL})
326- PLOTEOF
318+ {
319+ printf '### %s (%s) - UPDATE\n\n' "$LIBRARY" "$VARIANT"
320+ printf '| Before | After |\n'
321+ printf '|--------|-------|\n'
322+ printf '|  |  |\n\n' "$PREV_URL" "$NEW_URL"
323+ printf '[View version history (%s versions)](%s)\n' "$NEW_COUNT" "$HISTORY_URL"
324+ } >> plot_markdown.txt
327325 else
328- cat >> plot_markdown.txt << PLOTEOF
329- # ## ${LIBRARY} (${VARIANT}) - NEW
330-
331- 
332- PLOTEOF
326+ {
327+ printf '### %s (%s) - NEW\n\n' "$LIBRARY" "$VARIANT"
328+ printf '\n' "$LIBRARY" "$VARIANT" "$NEW_URL"
329+ } >> plot_markdown.txt
333330 fi
334331 echo "" >> plot_markdown.txt
335332 fi
You can’t perform that action at this time.
0 commit comments