From 7d2cc0096fd8d34162b68e5e83a47a35e0f3cf21 Mon Sep 17 00:00:00 2001 From: hotio Date: Sun, 3 Sep 2023 09:46:43 +0000 Subject: [PATCH] Updated some files [skip ci] --- .github/workflows/build.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4b2876b3d..b27ba5451 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -320,8 +320,8 @@ jobs: if [[ ${CHANGELOG} != null ]]; then VERSION="[${VERSION:----}](${CHANGELOG})" fi - if [[ ! -f "screenshot.png" ]]; then - curl -fsSL --retry 5 "https://hotio.dev/img/pullio-background.png" > screenshot.png + if [[ -f "screenshot.png" ]]; then + IMAGE_JSON=',"image": {"url": "attachment://screenshot.png"}' fi json='{ "embeds": [ @@ -348,11 +348,12 @@ jobs: "footer": { "text": "Powered by GitHub Actions" }, - "timestamp": "'$(date -u +'%FT%T.%3NZ')'", - "image": { - "url": "attachment://screenshot.png" - } + "timestamp": "'$(date -u +'%FT%T.%3NZ')'"'"${IMAGE_JSON}"' } ] }' - curl -fsSL --retry 5 -H "Content-Type: multipart/form-data" -F "file=@screenshot.png" -F "payload_json=${json}" "${DISCORD_WEBHOOK}" > /dev/null + if [[ -f "screenshot.png" ]]; then + curl -fsSL --retry 5 -H "Content-Type: multipart/form-data" -F "file=@screenshot.png" -F "payload_json=${json}" "${DISCORD_WEBHOOK}" > /dev/null + else + curl -fsSL --retry 5 -H "Content-Type: multipart/form-data" -F "payload_json=${json}" "${DISCORD_WEBHOOK}" > /dev/null + fi