Skip to content

Commit

Permalink
👷 : Modified Discord Message
Browse files Browse the repository at this point in the history
  • Loading branch information
PHPLukaas committed May 30, 2024
1 parent 053a903 commit b6e8ff1
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions codemagic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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

0 comments on commit b6e8ff1

Please sign in to comment.