Giter VIP home page Giter VIP logo

github-discord-updater's Introduction

GitHub Discord Updater

Application to retrieve GitHub updates and send them through Discord webhooks.

Purpose

The purpose of this application is to retrieve GitHub updates than Discord webhooks cannot process successfully due to the expected format of the payload from Discord.

Requirements

  • Node.js - Version 20.x

  • Discord Webhook URL

  • Environment variables:

    Variable Type Description Required Default Example
    HTTPS_CERT_FILEPATH String The file path of the HTTPS certificate file No None /path/to/cert.pem
    HTTPS_KEY_FILEPATH String The file path of the HTTPS key file No None /path/to/key.pem
    NODE_ENV String The environment where the application is running No None development
    PORT Number The port where the HTTP server will be running No 3000 9020
    PUBLIC_HOST_ADDRESS String The public address where the application is running Yes None example.com
    SHOULD_USE_HTTPS Boolean Whether the application should use HTTPS No false true

    Note:

    • The NODE_ENV variable is used to determine the environment where the application is running. It is highly recommended to set it to production when deploying the application to a production environment.

Development Tools

Supported GitHub Events

  • gollum

Building

Whenever you want to apply changes to the application, you must build the application in order to apply the changes.

In order to build the application, you must install the dependencies using the following command:

$ pnpm install

After installing the dependencies, you can build the application using the following command:

$ pnpm build

Running

Using Docker (Recommended)

In order to run the application using Docker, you must have Docker installed on your machine.

For running the application with Docker, you will need to mount both the SSL cert and key files using Docker volumes and map port 3000 to your host machine.

Docker CLI

  • Windows

    > docker run -dp 8080:8080 \
        -v <path\to\ssl-cert>:${HTTPS_CERT_FILEPATH} \
        -v <path\to\ssl-key>:${HTTPS_KEY_FILEPATH} \
        --env-file <path\to\env\file> \
        --name <container-name> \
        juansecu/github-discord-updater:v<version number>
  • MacOS/Linux

    $ docker run -dp 3000:3000 \
        --env-file <path/to/env/file> \
        --name <container-name> \
        juansecu/github-discord-updater:v<version number>

Docker Compose

For running the application with Docker Compose, you can use the Docker Compose file provided in this repository for development and production.

After configuring the environment variables, you can run the application using the following command:

  • Docker Compose v1
$ docker-compose up -d
  • Docker Compose v2
$ docker compose up -d

Using Node.js

In order to run the application using Node.js, you must have Node.js installed on your machine, and have PNPM installed globally on your machine.

For checking if you have PNPM installed globally on your machine, you can run the following command:

$ pnpm --version

If you don't have PNPM installed globally on your machine, you can install it using the following commands:

# Enable Corepack
$ corepack enable

# Install PNPM
$ corepack prepare pnpm@latest-8 --activate

After installing PNPM, you can run the following command to install the dependencies:

# Development
$ pnpm install

# Production
$ pnpm install --prod

After installing the dependencies, you can run the following command to start the application:

# Development
$ pnpm run start:dev

# Production
$ pnpm run start:prod

How to Use

For learning how to use the application, you can check the API documentation by visiting the path /api-docs on the application's URL.

Once you understand how to use the application, you can start using it to retrieve GitHub updates by adding the application's URL as a webhook to the GitHub repository you want to retrieve updates from.

github-discord-updater's People

Contributors

juansecu avatar

Watchers

 avatar

github-discord-updater's Issues

Replace Discord Webkook's ID and Token URL parameters by a query parameter

Since some people could not know how Discord Webhook URLs are structured, it may be better for them to include the entire webhook URL through a query parameter.

It is important to remember to validate Discord URLs. The following regular expression can be used for this job:

/^https://discord.com\/api\/webhooks\/([\d]+)\/([0-9A-Za-z_.-]+)$/

Add support to `milestone` event

Add support to milestone event, so it is possible to receive updates when milestones are:

  • created
  • opened
  • edited
  • closed
  • deleted

Document supported GitHub events

Since it is not clear which GitHub events are supported by the application, it is necessary to document them using any of these methods:

  • API documentation
  • README.md file

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.