1.0.0 • Published 11 months ago

discord-notify-action v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

Discord Notify Action

Welcome to the Discord Notify Action project repository. This project provides a GitHub Action for sending notifications to a Discord channel using a webhook. It is built with Node.js and MongoDB, and is fully containerized using Docker and Docker Compose.

Table of Contents

Usage

To use this GitHub Action in your workflows, include the following step in your .github/workflows YAML file:

For a raw message:

raw-message:
  runs-on: ubuntu-latest
  steps:
    - name: Discord notification
      env:
        DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
      uses: cabrera-evil/discord-notify-action@master
      with:
        message: 'A new commit has been pushed to cabrera-evil/discord-notify-action.'

For an embed message:

embed-message:
  runs-on: ubuntu-latest
  steps:
    - name: Discord notification
      env:
        DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
        DISCORD_EMBEDS: '{"title": "New commit", "description": "A new commit has been pushed to cabrera-evil/discord-notify-action."}'
      uses: cabrera-evil/discord-notify-action@master

Arguments

The action sends a notification with event information by default. You can override the default message by providing a custom message through the message input.

Examples

Here are some example message values you can use:

  • message = "The project {{ EVENT_PAYLOAD.repository.full_name }} has been deployed."

Environment Variables

The following environment variables can be configured:

  • DISCORD_WEBHOOK (required): The Discord Webhook URL.
  • DISCORD_USERNAME (optional): Overrides the bot's username in the notification.
  • DISCORD_AVATAR (optional): Overrides the bot's avatar image URL.
  • DISCORD_EMBEDS (optional): A valid JSON string of an array of Discord embed objects. For more information, refer to the Discord Webhook Embeds Documentation.

License

This repository is licensed under the MIT License. You are free to use, modify, and distribute as long as you include the original license text.

Contributing

We welcome and encourage contributions to enhance the functionality and usability of this project. Please contact the repository owner to discuss your ideas, or submit a pull request. All contributions will be reviewed and must meet the project's standards before being merged.

1.0.0

11 months ago