Skip to content

Commit

Permalink
Updated files #8
Browse files Browse the repository at this point in the history
  • Loading branch information
StrahinjaJacimovic committed Sep 13, 2024
1 parent f97503f commit 5a6e06e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/notify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,16 @@ jobs:
- name: Build Message with Python
id: build_message
run: |
MATTERMOST_MESSAGE=$(python -u scripts/build_message.py | base64)
echo "MATTERMOST_MESSAGE=$MATTERMOST_MESSAGE" >> $GITHUB_ENV
MATTERMOST_MESSAGE=$(python -u scripts/build_message.py)
# Escape newlines and quotes for JSON compatibility
MATTERMOST_MESSAGE_ESCAPED=$(echo "$MATTERMOST_MESSAGE" | jq -R .)
echo "MATTERMOST_MESSAGE=$MATTERMOST_MESSAGE_ESCAPED" >> $GITHUB_ENV
- name: Send notification to Mattermost
env:
MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }}
MATTERMOST_MESSAGE: ${{ env.MATTERMOST_MESSAGE }}
run: |
MESSAGE=$(echo "${{ steps.build_message.outputs.MATTERMOST_MESSAGE }}" | base64 --decode)
curl -X POST -H 'Content-Type: application/json' \
--data "{\"text\": \"$MESSAGE\"}" \
--data "{\"text\": $MATTERMOST_MESSAGE}" \
$MATTERMOST_WEBHOOK_URL

0 comments on commit 5a6e06e

Please sign in to comment.