Skip to content

Commit 5229777

Browse files
Fix github actions.
1 parent 7ab8a28 commit 5229777

1 file changed

Lines changed: 18 additions & 8 deletions

File tree

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,29 @@
11
name: Notify success
2-
description: Sends a notification that a workflow has finished
2+
description: Sends a notification that a workflow has finished.
33
inputs:
4-
DESTINATION_URL:
5-
description: 'Webhook notification URL'
4+
BOT_USERNAME:
5+
description: 'Username to use for the discord bot message'
6+
default: 'CC BuildBot'
7+
required: false
68
type: string
7-
WORKFLOW_NAME:
8-
description: 'Workflow name'
9+
BOT_AVATAR:
10+
description: 'URL to use for the avatar of the discord bot message'
11+
default: 'https://static.classicube.net/img/cc-cube-small.png'
12+
required: false
13+
type: string
14+
NOTIFY_MESSAGE:
15+
description: 'Notification message to send'
16+
required: true
17+
type: string
18+
WEBHOOK_URL:
19+
description: 'Discord webhook URL'
920
required: true
1021
type: string
1122

1223
runs:
1324
using: "composite"
1425
steps:
15-
- name: Notify failure
16-
if: ${{ inputs.DESTINATION_URL != '' }}
26+
- name: Notify Success
1727
shell: sh
1828
run: |
19-
curl ${{ inputs.DESTINATION_URL }}/${{ inputs.WORKFLOW_NAME }}/${{ github.sha }}
29+
curl ${{ inputs.WEBHOOK_URL }} -H "Accept: application/json" -H "Content-Type:application/json" -X POST --data "{\"username\": \"${{ inputs.BOT_USERNAME }}\", \"avatar_url\": \"${{ inputs.BOT_AVATAR }}\", \"content\": \"${{ inputs.NOTIFY_MESSAGE }}\" }"

0 commit comments

Comments
 (0)