Compare commits

...

18 Commits

Author SHA1 Message Date
akiel d43c92f406 Correct code flag behaviour 2020-08-15 12:43:31 +02:00
akiel a00e2b9fc1 Update version in the example 2020-08-14 17:14:48 +02:00
akiel 15e3ca292a Add icon 2020-08-14 17:12:03 +02:00
akiel 0669379328 Rename action 2020-08-14 17:09:36 +02:00
akiel 6ade5e1f14 Update readme with parameters and example 2020-08-14 17:03:06 +02:00
akiel 0d2a559372 Add code parameter 2020-08-14 16:51:12 +02:00
akiel d3cec0115d Remove debug line 2020-08-14 16:40:29 +02:00
akiel 9f19deb8ed Install ca-certificates on image 2020-08-14 16:35:39 +02:00
akiel 3da587e98c Add "'s to parameers 2020-08-14 16:33:28 +02:00
akiel 71e5ac5817 Set sh (again) 2020-08-14 16:25:00 +02:00
akiel bbfd4d87d6 Add back the print line 2020-08-14 16:23:31 +02:00
akiel 0c1fe6ed0b Add the actual rocket.chat notification application 2020-08-14 16:20:11 +02:00
akiel 96cf4f14d8 Change to bash 2020-08-14 16:08:39 +02:00
akiel b1c8b450a3 Add parameters and print them 2020-08-14 16:03:31 +02:00
akiel 7d1c5cce10 Add notification app 2020-08-14 15:52:21 +02:00
akiel dd226a1f62 Use sh instead of bash 2020-08-14 15:45:54 +02:00
akiel 173db15aa4 Add execution bit to entrypoint 2020-08-14 15:41:07 +02:00
akiel 5601a4fb8b Correct filename 2020-08-14 15:40:53 +02:00
5 changed files with 94 additions and 12 deletions
-3
View File
@@ -1,3 +0,0 @@
FROM alpine:3.10
COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
+5
View File
@@ -0,0 +1,5 @@
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
ENTRYPOINT ["/entrypoint.sh"]
+49 -2
View File
@@ -1,4 +1,51 @@
# Rocket.Chat notifications GitHub action
This is my first action so I'll experiment here.
I'll write nice docs once I have at least a POC.
This action will write a message on your rocket.chat server using credentials instead of a webhook.
## 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
View File
@@ -1,9 +1,38 @@
# action.yml
name: 'Rocket.Chat Notification'
name: 'Rocket.Chat notification with credentials'
description: 'Send a message to Rocket.Chat'
outputs:
response_code:
description: 'The response code for the http call'
branding:
icon: 'bell'
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:
using: 'docker'
image: 'Dockerfile'
args:
- ${{ inputs.user }}
- ${{ inputs.password }}
- ${{ inputs.message }}
- ${{ inputs.server }}
- ${{ inputs.channel }}
- ${{ inputs.code }}
Regular → Executable
+6 -2
View File
@@ -1,2 +1,6 @@
#!/usr/bin/env bash
echo "something going on here"
#!/usr/bin/env sh
if $6 == "true"; then
rocketchat-notification -u "$1" -p "$2" -m "$3" -s "$4" -c "$5" -code
else
rocketchat-notification -u "$1" -p "$2" -m "$3" -s "$4" -c "$5"
fi