Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
matrozov committed Aug 10, 2021
1 parent b4a0393 commit 412d745
Show file tree
Hide file tree
Showing 8 changed files with 493 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: test
on: [push]
jobs:
test:
runs-on: ubuntu-latest
name: Notification test
steps:

- name: Checkout
uses: actions/checkout@v2

- name: Text only
uses: ./
with:
token: ${{ secrets.TOKEN }}
text: ${{ github.run_id }} (1/8) Alert message

- name: Full fields
uses: ./
with:
token: ${{ secrets.TOKEN }}
title: Alert title
text: ${{ github.run_id }} (2/8) Alert message
priority: highest
level: success

- name: Verbose
uses: ./
with:
token: ${{ secrets.TOKEN }}
verbose: ${{ github.run_id }} (3/8) Verbose message

- name: Info
uses: ./
with:
token: ${{ secrets.TOKEN }}
info: ${{ github.run_id }} (4/8) Info message

- name: Notice
uses: ./
with:
token: ${{ secrets.TOKEN }}
notice: ${{ github.run_id }} (5/8) Notice message

- name: Success
uses: ./
with:
token: ${{ secrets.TOKEN }}
success: ${{ github.run_id }} (6/8) Success message

- name: Warning
uses: ./
with:
token: ${{ secrets.TOKEN }}
warning: ${{ github.run_id }} (7/8) Warning message

- name: Error
uses: ./
with:
token: ${{ secrets.TOKEN }}
error: ${{ github.run_id }} (8/8) Error message
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.idea
/node_modules/
60 changes: 60 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Notify.Events for GitHub Action

[GitHub Action](https://github.com/features/actions) for sending a notification message for [30+ messengers and other services](https://notify.events#sRecipients).

[![Actions Status](https://github.com/notify-events/github-action/workflows/test/badge.svg)](https://github.com/notify-events/github-action/actions)
[![MIT License](https://img.shields.io/apm/l/atomic-design-ui.svg?)](https://github.com/notify-events/github-action/blob/master/LICENSEs)

## Usage

Send custom message

```yaml
name: notify.events message
on: [push]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: send custom message
uses: notify-events/github-action@main
with:
token: ${{ secrets.NE_CHANNEL_TOKEN }}
text: This is message
```
## Input variables
* token - (**required**) Notify.Events channel token
* title - Message title
* text - (**required**) Message text (allow simple html tags: \<b>, \<i>, \<br>, \<a href="...">)
* priority - Message priority (highest, high, normal, low, lowest)
* level - Message level (verbose, info, notice, warning, error, success)
```yaml
uses: notify-events/github-action@main
with:
token: ${{ secrets.NE_CHANNEL_TOKEN }}
title: Build success
text: Build ${{ github.ref }} successfully
priority: info
level: success
```
### Predefined simple message:
* verbose - Message text with 'verbose' level and 'lowest' priority
* info - Message text with 'info' level and 'low' priority
* notice - Message text with 'notice' level and 'low' priority
* success - Message text with 'success' level and 'normal' priority
* warning - Message text with 'warning' level and 'high' priority
* error - Message text with 'error' level and 'highest' priority
```yaml
uses: notify-events/github-action@main
with:
token: $(( secrets.NE_CHANNEL_TOKEN }}
success: Build {{ github.ref }} successfully
```
68 changes: 68 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Notify.Events
author: Notify.Events
description: Sending message to 30+ messangers

inputs:

token:
description: |
Notify.Events channel token
required: true

title:
description: |
Message title
required: false

text:
description: |
Message Text (allowed simple html tags: <b>, <i>, <br>, <a href="">)
required: false

priority:
description: |
Message priority (highest, high, normal, low, lowest)
required: false

level:
description: |
Message Level (verbose, info, notice, warning, error, success)
required: false

verbose:
description: |
Message text with 'verbose' level and 'lowest' priority
required: false

info:
description: |
Message text with 'info' level and 'low' priority
required: false

notice:
description: |
Message text with 'notice' level and 'low' priority
required: false

success:
description: |
Message text with 'success' level and 'normal' priority
required: false

warning:
description: |
Message text with 'warning' level and 'high' priority
required: false

error:
description: |
Message text with 'error' level and 'highest' priority
required: false

runs:
using: node12
main: dist/index.js

branding:
icon: message-circle
color: red
7 changes: 7 additions & 0 deletions dist/index.js

Large diffs are not rendered by default.

170 changes: 170 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "github-action",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"build": "ncc build -m src/index.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/notify-events/github-action.git"
},
"keywords": [],
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/notify-events/github-action/issues"
},
"homepage": "https://github.com/notify-events/github-action#readme",
"dependencies": {
"@actions/core": "^1.4.0",
"@actions/github": "^5.0.0",
"node-fetch": "^2.6.1"
}
}
Loading

0 comments on commit 412d745

Please sign in to comment.