diff --git a/.github/workflows/matrix_notify.yaml b/.github/workflows/matrix_notify.yaml
new file mode 100644
index 000000000..6685cad16
--- /dev/null
+++ b/.github/workflows/matrix_notify.yaml
@@ -0,0 +1,49 @@
+name: Matrix Notification
+
+on:
+ issues:
+ types: [opened]
+ pull_request:
+ types: [opened]
+
+jobs:
+ notify:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Send notification to Matrix room
+ env:
+ HOMESERVER: ${{ secrets.MATRIX_HOMESERVER }}
+ ACCESS_TOKEN: ${{ secrets.MATRIX_ACCESS_TOKEN }}
+ ROOM_ID: ${{ secrets.MATRIX_ROOM_ID }}
+ EVENT_NAME: ${{ github.event_name }}
+ ISSUE_TITLE: ${{ github.event.issue.title }}
+ ISSUE_URL: ${{ github.event.issue.html_url }}
+ PR_TITLE: ${{ github.event.pull_request.title }}
+ PR_URL: ${{ github.event.pull_request.html_url }}
+ run: |
+ if [ "${EVENT_NAME}" = "issues" ]; then
+ PREFIX="New issue"
+ TITLE="${ISSUE_TITLE}"
+ URL="${ISSUE_URL}"
+ else
+ PREFIX="New pull request"
+ TITLE="${PR_TITLE}"
+ URL="${PR_URL}"
+ fi
+
+ PLAIN="${PREFIX}: ${TITLE} - ${URL}"
+ HTML="${PREFIX}: ${TITLE} - ${URL}"
+ TXN_ID=$(date +%s%N)
+
+ curl -s -o /dev/null -w "%{http_code}" -X PUT \
+ "${HOMESERVER}/_matrix/client/v3/rooms/${ROOM_ID}/send/m.room.message/${TXN_ID}" \
+ -H "Authorization: Bearer ${ACCESS_TOKEN}" \
+ -H "Content-Type: application/json" \
+ -d @- <