From 1b97c2328c936526aae9415007f57d7abc46ed0b Mon Sep 17 00:00:00 2001 From: hotio Date: Sun, 3 Sep 2023 09:46:33 +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 4b2876b..b27ba54 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