summaryrefslogtreecommitdiff
path: root/.github/workflows/notify.yml
diff options
context:
space:
mode:
authormbkma <[email protected]>2025-08-14 21:30:32 +0200
committerLuke from DC <[email protected]>2025-08-21 04:18:04 +0000
commited3d1a39b9543bb0acec8b824e1e999952ccb123 (patch)
treed1f7d35bccada68f13d06552277dc6c658dc1358 /.github/workflows/notify.yml
parent7ef327f6f269c7a49357e001cd41d7aaf5807749 (diff)
downloadmate-calc-ed3d1a39b9543bb0acec8b824e1e999952ccb123.tar.bz2
mate-calc-ed3d1a39b9543bb0acec8b824e1e999952ccb123.tar.xz
use github actions
Diffstat (limited to '.github/workflows/notify.yml')
-rw-r--r--.github/workflows/notify.yml44
1 files changed, 44 insertions, 0 deletions
diff --git a/.github/workflows/notify.yml b/.github/workflows/notify.yml
new file mode 100644
index 0000000..12e39ee
--- /dev/null
+++ b/.github/workflows/notify.yml
@@ -0,0 +1,44 @@
+name: Notifications
+
+on:
+ push:
+ branches: [ master, main ]
+ tags: [ 'v*' ]
+ workflow_run:
+ workflows: ["Build and Test"]
+ types:
+ - completed
+
+jobs:
+ irc-notify:
+ runs-on: ubuntu-latest
+ if: >
+ (github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/'))) ||
+ (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'failure')
+
+ steps:
+ - name: Send IRC notification on success
+ if: >
+ (github.event_name == 'push') ||
+ (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success')
+ uses: Gottox/irc-message-action@v2
+ continue-on-error: true
+ with:
+ server: irc.libera.chat
+ channel: '#mate-dev'
+ nickname: mate-github-bot
+ message: |
+ [mate-calc] ${{ github.actor }}: ${{ github.event.head_commit.message || 'Workflow completed successfully' }}
+ [${{ github.ref_name }}] ${{ github.sha }} Success ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
+
+ - name: Send IRC notification on failure
+ if: github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'failure'
+ uses: Gottox/irc-message-action@v2
+ continue-on-error: true
+ with:
+ server: irc.libera.chat
+ channel: '#mate-dev'
+ nickname: mate-github-bot
+ message: |
+ [mate-calc] Build failed: ${{ github.event.workflow_run.head_commit.message }}
+ [${{ github.event.workflow_run.head_branch }}] ${{ github.event.workflow_run.head_sha }} Failure ${{ github.event.workflow_run.html_url }} \ No newline at end of file