Skip to content

Commit

Permalink
feat: first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Arael D. Espinosa committed Feb 3, 2023
0 parents commit 52da597
Show file tree
Hide file tree
Showing 23 changed files with 14,331 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
INPUT_MESSAGE=
INPUT_WEBHOOK=
17 changes: 17 additions & 0 deletions .github/workflows/Test action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Notification on push

on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Discord notifications
uses: cl8dep/action-discord@main
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
message: A new commit has been pushed to cl8dep/action-discord.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
.env
53 changes: 53 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# 🚀 Discord for GitHub Actions

[![Build Status][build-badge]][build-url]

Sends a Discord notification message. Simple as that.
Supports all [workflow event types](https://developer.github.com/webhooks/#events) by using the [Discord GitHub webhooks](https://discordapp.com/developers/docs/resources/webhook#execute-githubcompatible-webhook).

*Appearance on Discord :*

![Discord message](docs/preview.png "Discord message")

<!-- This GitHub action is part of a list of Actions that are located in an other repo. Feel free to check it out : https://github.com/Ilshidur/actions. -->

## Usage

```yaml
- name: Discord notification
uses: cl8dep/action-discord@v0
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
message: 'Hello World'
```
### Arguments
By default, the GitHub action will send a notificaction with the event informations. Providing the arguments will override the message.
### Arguments
* **`webhook`** (**required**): the Discord webhook URL (see https://support.discordapp.com/hc/en-us/articles/228383668-Intro-to-Webhooks).
* **`message`** (*required*): the message to send.
* **`username`** (*optional*): overrides the bot nickname.
* **`avatar`** (*optional*): overrides the avatar URL.
<!-- * **`DISCORD_EMBEDS`** (*optional*): This should be a valid JSON string of an array of Discord `embed` objects. See the [documentation on Discord WebHook Embeds](https://birdie0.github.io/discord-webhooks-guide/structure/embeds.html) for more information. You can use set it to `${{ toJson(my_value) }}` using [`toJson()`](https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#tojson) if your input is an object value. -->
That's all.

## Alternatives

Because open source is about everyone :

https://github.com/marketplace/actions/discord-message-notify <br/>
![](https://img.shields.io/github/stars/appleboy/discord-action.svg?label=Stars&style=social)


<hr/>

<p align="center">
Don't forget to 🌟 Star 🌟 the repo if you like this GitHub Action !<br/>
<a href="https://github.com/Ilshidur/action-discord/issues/new">Your feedback is appreciated</a>
</p>

[build-badge]: https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2FIlshidur%2Faction-discord%2Fbadge&style=flat
[build-url]: https://actions-badge.atrox.dev/Ilshidur/action-discord/goto
23 changes: 23 additions & 0 deletions action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: 'Discord notifications'
description: 'Send a message to Discord chanel'
branding:
icon: message-square
color: blue
inputs:
webhook:
description: 'The Webhook URL used to access to Discord chanel'
required: true
message:
description: 'The message'
required: true
username:
description: 'Username'
required: false
default: 'Github'
avatar:
description: 'Bot avatar'
required: false
default: 'https://avatars.githubusercontent.com/u/9919?s=280&v=4'
runs:
using: 'node16'
main: './dist/index.js'
6 changes: 6 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
presets: [
['@babel/preset-env', {targets: {node: 'current'}}],
'@babel/preset-typescript',
],
};
49 changes: 49 additions & 0 deletions dist/entrypoint.js

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

1 change: 1 addition & 0 deletions dist/entrypoint.js.map

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

16 changes: 16 additions & 0 deletions dist/entrypoint.test.js

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

1 change: 1 addition & 0 deletions dist/entrypoint.test.js.map

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

Loading

0 comments on commit 52da597

Please sign in to comment.