Skip to content

Commit

Permalink
add notify to discord workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
JeromeBu committed May 19, 2023
1 parent ca3024e commit 243d0bd
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/cd-discord-notification.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Discord Notification

on:
workflow_call:
inputs:
environment:
type: string
description: Environment to send notification to. Will change the discord chanel.
required: true
DISCORD_WEBHOOK_URL:
type: string
description: Discord webhook URL
required: true
# secrets:
# DISCORD_WEBHOOK_URL:
# required: true

jobs:
send-notification:
# environment: ${{ inputs.environment }}
runs-on: ubuntu-latest
steps:
- name: Send Discord notification
run: |
curl -X POST -H "Content-Type: application/json" -d '{
"content": "Hello from GitHub Actions!",
"embeds": [
{
"title": "URLs",
"fields": [
{
"name": "URL 1",
"value": "https://example1.com"
},
{
"name": "URL 2",
"value": "https://example2.com"
},
{
"name": "URL 3",
"value": "https://example3.com"
}
]
}
]
}' $DISCORD_WEBHOOK_URL

0 comments on commit 243d0bd

Please sign in to comment.