Skip to content

Add Github action to send notification to Converse XMPP chatroom #34

Add Github action to send notification to Converse XMPP chatroom

Add Github action to send notification to Converse XMPP chatroom #34

Workflow file for this run

name: 'XMPP Notifier'
on:
push:
branches: [ "master", "jcbrand/xmpp-notify"]
pull_request:
branches: [ "master", "jcbrand/xmpp-notify"]
jobs:
notif-script:
runs-on: ubuntu-latest
name: job that pushes repo news to xmpp
steps:
- name: push_info_step
id: push
uses: conversejs/converse.js@jcbrand/xmpp-notify
if: github.event_name == 'push'
with: # Set the secrets as inputs
# jid expects the bot's bare jid (user@domain)
jid: ${{ secrets.jid }}
password: ${{ secrets.password }}
server_host: ${{ secrets.server_host }}
recipient: ${{ secrets.recipient }}
server_port: ${{ secrets.server_port }}
message: |
${{ github.actor }} pushed ${{ github.event.ref }} ${{ github.event.compare }} with message:
${{ join(github.event.commits.*.message) }}
recipient_is_room: true
- name: pr_open_info_step
id: pull_request_open
uses: conversejs/converse.js@jcbrand/xmpp-notify
# Will only get triggered when a pull request to master is created
if: github.event_name == 'pull_request' && github.event.action == 'opened'
with: # Set the secrets as inputs
jid: ${{ secrets.jid }}
password: ${{ secrets.password }}
server_host: ${{ secrets.server_host }}
recipient: ${{ secrets.recipient }}
message: |
${{ github.actor }} opened a PR : ${{ github.event.pull_request.html_url }} with message :
${{ github.event.pull_request.title }}
recipient_is_room: true
- name: pr_edit_info_step
id: pull_request_edit
uses: conversejs/converse.js@jcbrand/xmpp-notify
# Will only get triggered when a pull request to master is created
if: github.event_name == 'pull_request' && github.event.action == 'edited'
with: # Set the secrets as inputs
jid: ${{ secrets.jid }}
password: ${{ secrets.password }}
server_host: ${{ secrets.server_host }}
recipient: ${{ secrets.recipient }}
message: |
${{ github.actor }} edited the following PR : ${{ github.event.pull_request.html_url }} with message :
${{ github.event.pull_request.title }}
recipient_is_room: true