mirror of
https://github.com/jadolg/rocketchat-notification-action.git
synced 2026-07-10 20:27:44 +00:00
Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a00e2b9fc1 | |||
| 15e3ca292a | |||
| 0669379328 | |||
| 6ade5e1f14 | |||
| 0d2a559372 | |||
| d3cec0115d | |||
| 9f19deb8ed | |||
| 3da587e98c | |||
| 71e5ac5817 | |||
| bbfd4d87d6 | |||
| 0c1fe6ed0b | |||
| 96cf4f14d8 | |||
| b1c8b450a3 | |||
| 7d1c5cce10 | |||
| dd226a1f62 |
@@ -1,3 +1,5 @@
|
|||||||
FROM alpine:3.10
|
FROM alpine:3.10
|
||||||
|
RUN apk --no-cache add ca-certificates
|
||||||
|
RUN wget https://github.com/aleph-engineering/rocketchat-notification/releases/download/1.4.1/rocketchat-notification -P /usr/bin/ && chmod +x /usr/bin/rocketchat-notification
|
||||||
COPY entrypoint.sh /entrypoint.sh
|
COPY entrypoint.sh /entrypoint.sh
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
|
|||||||
@@ -1,4 +1,51 @@
|
|||||||
# Rocket.Chat notifications GitHub action
|
# Rocket.Chat notifications GitHub action
|
||||||
|
|
||||||
This is my first action so I'll experiment here.
|
This action will write a message on your rocket.chat server using credentials instead of a webhook.
|
||||||
I'll write nice docs once I have at least a POC.
|
|
||||||
|
## Inputs
|
||||||
|
|
||||||
|
### `user`
|
||||||
|
|
||||||
|
**Required** The username to login to your rocket.chat server.
|
||||||
|
|
||||||
|
### `password`
|
||||||
|
|
||||||
|
**Required** The password to login to your rocket.chat server.
|
||||||
|
|
||||||
|
### `message`
|
||||||
|
|
||||||
|
**Required** The message you want to send.
|
||||||
|
|
||||||
|
### `server`
|
||||||
|
|
||||||
|
Your rocket.chat server. Default `"https://open.rocket.chat"`.
|
||||||
|
|
||||||
|
### `channel`
|
||||||
|
|
||||||
|
The channel you want to write to. Default `"GENERAL"`.
|
||||||
|
|
||||||
|
### `code`
|
||||||
|
|
||||||
|
Set it to true if you wish to have a code block. Default `"false"`.
|
||||||
|
|
||||||
|
## Example usage
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
on: [push]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
rocketchat_job:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: Push notification to rocket.chat
|
||||||
|
steps:
|
||||||
|
- name: Push notification to rocket.chat if the job failed
|
||||||
|
id: error-notification
|
||||||
|
if: ${{ failure() }}
|
||||||
|
uses: jadolg/rocketchat-notification-action@v1.0.0
|
||||||
|
with:
|
||||||
|
server: ${{ secrets.ROCKETCHAT_SERVER }}
|
||||||
|
message: Wooops! Looks like something went wrong!
|
||||||
|
user: ${{ secrets.ROCKETCHAT_USER }}
|
||||||
|
password: ${{ secrets.ROCKETCHAT_PASSWORD }}
|
||||||
|
channel: alerts
|
||||||
|
```
|
||||||
|
|||||||
+34
-5
@@ -1,9 +1,38 @@
|
|||||||
# action.yml
|
name: 'Rocket.Chat notification with credentials'
|
||||||
name: 'Rocket.Chat Notification'
|
|
||||||
description: 'Send a message to Rocket.Chat'
|
description: 'Send a message to Rocket.Chat'
|
||||||
outputs:
|
branding:
|
||||||
response_code:
|
icon: 'bell'
|
||||||
description: 'The response code for the http call'
|
color: 'red'
|
||||||
|
inputs:
|
||||||
|
user:
|
||||||
|
description: 'The username to login to your rocket.chat server'
|
||||||
|
required: true
|
||||||
|
default: ''
|
||||||
|
password:
|
||||||
|
description: 'The password to login to your rocket.chat server'
|
||||||
|
required: true
|
||||||
|
message:
|
||||||
|
description: 'The message you want to send'
|
||||||
|
required: true
|
||||||
|
server:
|
||||||
|
description: 'Your rocket.chat server'
|
||||||
|
required: false
|
||||||
|
default: 'https://open.rocket.chat'
|
||||||
|
channel:
|
||||||
|
description: 'The channel you want to write to'
|
||||||
|
required: false
|
||||||
|
default: 'GENERAL'
|
||||||
|
code:
|
||||||
|
description: 'Set it to true if you wish to have a code block'
|
||||||
|
required: false
|
||||||
|
default: 'false'
|
||||||
runs:
|
runs:
|
||||||
using: 'docker'
|
using: 'docker'
|
||||||
image: 'Dockerfile'
|
image: 'Dockerfile'
|
||||||
|
args:
|
||||||
|
- ${{ inputs.user }}
|
||||||
|
- ${{ inputs.password }}
|
||||||
|
- ${{ inputs.message }}
|
||||||
|
- ${{ inputs.server }}
|
||||||
|
- ${{ inputs.channel }}
|
||||||
|
- ${{ inputs.code }}
|
||||||
|
|||||||
+2
-2
@@ -1,2 +1,2 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env sh
|
||||||
echo "something going on here"
|
rocketchat-notification -u "$1" -p "$2" -m "$3" -s "$4" -c "$5" -code "$6"
|
||||||
|
|||||||
Reference in New Issue
Block a user