🔔 Send a custom message with repo infos to a Threema Broadcast Group using github actions.
| Name | Required | Description |
|---|---|---|
| THREEMA_URL | yes | Url to your Threema broadcast Group (POST will be sent to this) |
| THREEMA_XAPIKEY | yes | Your Threema X-API-Key |
| job | yes | Job data as json : ${{toJson(job)}} |
| message | yes | The message text to send to the group |
Add two Secrets to your repo
-
THREEMA_URL
- Threema Group URL will look something like this:
https://broadcast.threema.ch/api/v1/identities/{broadcastUid}/groups/{groupUid}/chat
- Threema Group URL will look something like this:
-
THREEMA_XAPIKEY
- X-API-Key can be generated at:
Threema Broadcast > Settings > Your profile > API Keys.
- X-API-Key can be generated at:
To get more infos about threema API: API Docs
Then create or edit an action at .github/workflows/youraction.yaml.
on: [push]
jobs:
demojob:
runs-on: ubuntu-latest
name: Send Threema Alert
steps:
- name: Send Threema message
id: alert
if: always() # Always run the job, so failures are reported / alerted.
uses: FabioTavernini/notify-threema-broadcast@v1
with:
THREEMA_URL: ${{ secrets.THREEMA_URL }}
THREEMA_XAPIKEY: ${{ secrets.THREEMA_XAPIKEY }}
job: ${{ toJson(job) }}
message: 'Hello from github'
- name: Get outputs
run: |
echo "response ${{ steps.Alert.outputs.response }}"
echo "status ${{ steps.Alert.outputs.status }}"on: [push]
jobs:
demojob:
runs-on: ubuntu-latest
name: Send Threema Alert
steps:
- name: Send Threema message
id: alert
if: always() # Always run the job, so failures are reported / alerted.
uses: FabioTavernini/notify-threema-broadcast@v1
with:
THREEMA_URL: ${{ secrets.THREEMA_URL }}
THREEMA_XAPIKEY: ${{ secrets.THREEMA_XAPIKEY }}
job: ${{ toJson(job) }}
message: '${{ github.event.head_commit.message }}'
- name: Get outputs
run: |
echo "response ${{ steps.Alert.outputs.response }}"
echo "status ${{ steps.Alert.outputs.status }}"on: [push]
jobs:
demojob:
runs-on: ubuntu-latest
name: Send Threema Alert
steps:
- name: Send Threema message
id: alert
if: failure() # Only run if job has failed
uses: FabioTavernini/notify-threema-broadcast@v1
with:
THREEMA_URL: ${{ secrets.THREEMA_URL }}
THREEMA_XAPIKEY: ${{ secrets.THREEMA_XAPIKEY }}
job: ${{ toJson(job) }}
message: 'Hello from github'
- name: Get outputs
run: |
echo "response ${{ steps.Alert.outputs.response }}"
echo "status ${{ steps.Alert.outputs.status }}"If you want to style/customize your message further, have a look at the guide here.
Feel free to contribute in any way, shape or form.
This project is not affiliated with @Threema. The Threema Broadcast API is used in this action as an external service, and the creator of this action is not responsible for any issues that arise from Threema’s service or changes to their API.