summary refs log tree commit diff
path: root/.github/actions/notify_failure
diff options
context:
space:
mode:
authorWlodekM <[email protected]>2024-06-16 10:35:45 +0300
committerWlodekM <[email protected]>2024-06-16 10:35:45 +0300
commitabef6da56913f1c55528103e60a50451a39628b1 (patch)
treeb3c8092471ecbb73e568cd0d336efa0e7871ee8d /.github/actions/notify_failure
initial commit
Diffstat (limited to '.github/actions/notify_failure')
-rw-r--r--.github/actions/notify_failure/action.yml30
1 files changed, 30 insertions, 0 deletions
diff --git a/.github/actions/notify_failure/action.yml b/.github/actions/notify_failure/action.yml
new file mode 100644
index 0000000..3ca4019
--- /dev/null
+++ b/.github/actions/notify_failure/action.yml
@@ -0,0 +1,30 @@
+name: Notify failure
+description: Sends a notification that compiling a build has failed
+inputs:
+  BOT_USERNAME:
+    description: 'Username to use for the discord bot message'
+    default: 'CC BuildBot'
+    required: false
+    type: string
+  BOT_AVATAR:
+    description: 'URL to use for the avatar of the discord bot message'
+    default: 'https://static.classicube.net/img/cc-cube-small.png'
+    required: false
+    type: string
+  NOTIFY_MESSAGE:
+    description: 'Notification message to send'
+    required: true
+    type: string
+  WEBHOOK_URL:
+    description: 'Discord webhook URL'
+    required: true
+    type: string
+
+runs:
+  using: "composite"
+  steps:
+    - name: Notify failure
+      shell: sh
+      if: ${{ inputs.WEBHOOK_URL != '' }}
+      run: |
+        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 }}\" }"
\ No newline at end of file