Skip to content

Commit

Permalink
gh action: current feed updated
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored and mohammad5305 committed Feb 10, 2024
1 parent b7ddafb commit eaab871
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crawl_news.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ export SHORT_COMMITS URL CHANNEL_ID

if [ -f "$OLD_FEED" ]
then
jq -s -r '(.[0] - .[1])[] | ( (.commit.message / "\n\n") as $msg | if ( $msg | length ) > 1 then "<b>"+ $msg[0] + "</b>", ( $msg[1:][] | gsub("\n"; " ") ), .html_url else "<a href=\"" + .html_url + "\">" + $msg[0] + "</a>" end), "----"' "$CURRENT_FEED" "$OLD_FEED" | tac -s '----' | sed 's/----/\x0/' | xargs -0 -I{} -- bash -c 'push_news "$@"' _ {}
jq -s -r '(.[0] - .[1])[] | ( (.commit.message / "\n\n") as $msg | if ( $msg | length ) > 1 then "<b>"+ $msg[0] + "</b>", ( $msg[1:][] | gsub("\n "; "") ), .html_url else "<a href=\"" + .html_url + "\">" + $msg[0] + "</a>" end), "----"' "$CURRENT_FEED" "$OLD_FEED" | tac -s '----' | sed 's/----/\x0/' | xargs -0 -I{} -- bash -c 'push_news "$@"' _ {}
else
jq -r '.[] | ( (.commit.message / "\n\n") as $msg | if ( $msg | length ) > 1 then "<b>"+ $msg[0] + "</b>", $msg[1:][], .html_url else "<a href=\"" + .html_url + "\">" + $msg[0] + "</a>" end), "----"' "$CURRENT_FEED" | tac -s '----' | sed 's/----/\x0/' | xargs -0 -I{} -- bash -c 'push_news "$@"' _ {}
jq -r '.[] | ( (.commit.message / "\n\n") as $msg | if ( $msg | length ) > 1 then "<b>"+ $msg[0] + "</b>", ( $msg[1:][] | gsub("\n "; "") ), .html_url else "<a href=\"" + .html_url + "\">" + $msg[0] + "</a>" end), "----"' "$CURRENT_FEED" | tac -s '----' | sed 's/----/\x0/' | xargs -0 -I{} -- bash -c 'push_news "$@"' _ {}
fi

[ -s "$SHORT_COMMITS" ] && curl -s -X POST $URL -d chat_id=$CHANNEL_ID -d parse_mode="HTML" -d text="<b>minor changes:</b>"$'\n'"$(cat $SHORT_COMMITS)"
Expand Down

0 comments on commit eaab871

Please sign in to comment.