Update send_notification.yml #12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Send Notification on Release | |
on: | |
release: | |
types: | |
- published | |
push: | |
branches: | |
- main | |
jobs: | |
notify: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Send Notification | |
run: | | |
echo "Starting the notification process..." | |
response=$(curl --request POST \ | |
--url https://onesignal.com/api/v1/notifications \ | |
--header 'Authorization: Basic ${{ secrets.ONESIGNAL_API_KEY }}' \ | |
--header 'accept: application/json' \ | |
--header 'content-type: application/json' \ | |
--data ' | |
{ | |
"app_id": "${{ secrets.ONESIGNAL_APP_ID }}", | |
"included_segments": ["All"], | |
"headings": {"en": "${{ github.event.release.name }}"}, | |
"contents": {"en": "${{ github.event.release.body }}"}, | |
"url": "${{ github.event.release.html_url }}" | |
} | |
') | |
echo "Notification sent. Response from OneSignal: $response" |