From b6e8ff1476cae9ff79ecd28758c30d6209540942 Mon Sep 17 00:00:00 2001 From: Lukas Date: Thu, 30 May 2024 23:14:19 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20:=20Modified=20Discord=20Message?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- codemagic.yaml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/codemagic.yaml b/codemagic.yaml index 61450a4..c6619ff 100644 --- a/codemagic.yaml +++ b/codemagic.yaml @@ -82,7 +82,11 @@ workflows: - name: Discord notification script: | set -ex - APP_LINK=$(echo $CM_ARTIFACT_LINKS | jq -r '.[] | select(.name=="app.aab") | .url') + # Convertir le tableau JSON en une liste de liens + APP_LINKS=$(echo $CM_ARTIFACT_LINKS | jq -r '.[] | .url') + + # Convertir la liste de liens en une chaƮne avec des sauts de ligne + APP_LINKS=$(echo $APP_LINKS | tr ' ' '\n') # Get first 7 digits of commit number COMMIT=$(echo "${CM_COMMIT}" | sed 's/^\(........\).*/\1/;q') @@ -93,8 +97,8 @@ workflows: # Get commit author AUTHOR=$(git show -s --format='%ae' $CM_COMMIT) - # Publish the notification + # Utiliser APP_LINKS dans la notification curl -H "Content-Type: multipart/form-data" \ - -F 'payload_json={"username" : "codemagic-bot", "content": "**Commit:** `'"$COMMIT"'`\n\n**Commit message:** '"$COMMIT_MESSAGE"'\n\n**Branch:** '"$CM_BRANCH"'\n\n**Author:** '"$AUTHOR"'\n\n**Artifacts: **\n\n'"$APP_LINK"'\n\n"}' \ + -F 'payload_json={"username" : "codemagic-bot", "content": "@everyone\n**Commit:** `'"$COMMIT"'`\n\n**Commit message:** '"$COMMIT_MESSAGE"'\n\n**Branch:** '"$CM_BRANCH"'\n\n**Author:** '"$AUTHOR"'\n\n**Artifacts: **\n\n'"$APP_LINKS"'\n\n"}' \ -F "file1=@release_notes.txt" \ $WEBHOOK_URL \ No newline at end of file