Skip to content

Update lint-and-build-job.yml #13

Update lint-and-build-job.yml

Update lint-and-build-job.yml #13

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"