A Github webhook server to help with CI/CD written in Rust.

Overview

This application will automatically updates local GitHub repositories and triggers a command once the update is complete. This can be extremely useful, for example, for automating deployment to a production server.

How to use

Github webhook server for CI/CD                                                
                                                                            
Usage: rust-webhook-server [OPTIONS]                                    
                                                                            
Options:                                                                    
  -c, --config <CONFIG>  Path to to the config file [default: ./config.toml]
  -h, --help             Print help                                         
  -V, --version          Print version

🚧 Project configuration

The configuration follows the toml format. The top level keys contain common configurations, and the sections contain project specific configurations. Here's an example configuration:

port = 3003
git = "C:\\Program Files\\Git\\cmd\\git.exe"

[[repos]]
repo = "LucaCoduriV/rust-webhook-server"
secret = "MY_BIG_SECRET"
branch = "main"
repo_directory = "."
working_directory = "."
command = "powershell"
args = ["./testscript.ps1"]
events = ["push", "create"]

[[repos]]
repo = "2"
working_directory = "."
repo_directory = "../repo2/"

Common configurations

Key Description Required Default
port port to run the server on Yes
git path to the git executable No default git dir

Repo configurations

Key Description Required Default
repo GitHub repository in format username/repository Yes
secret The secret set in Github No
branch Branch to update No main
repo_directory path to the repo Yes
working_directory path from where to run the commands No current dir
command a program to execute No
args arguments of the command No
events a list of events (see below) No All

Creating a webhook in GitHub

See GitHub's Creating Webhooks guide. Currently, the server only supports JSON payloads. The payload needs to be sent to http://yourserverip:port/hook

Available events

For mor details look at the Github webhook documentation

  • branch_protection_rule
  • check_run
  • check_suite
  • code_scanning_alert
  • commit_comment
  • create
  • delete
  • dependabot_alert
  • deploy_key
  • deployment
  • deployment_status
  • discussion
  • discussion_comment
  • fork
  • github_app_authorization
  • gollum
  • installation
  • installation_repositories
  • installation_target
  • issue_comment
  • issues
  • label
  • marketplace_purchase
  • member
  • membership
  • merge_group
  • meta
  • milestone
  • org_block
  • organization
  • package
  • page_build
  • personal_access_token_request
  • ping
  • project_card
  • project
  • project_column
  • project_v2
  • project_v2_item
  • public
  • pull_request
  • pull_request_review_comment
  • pull_request_review
  • pull_request_review_thread
  • push
  • registry_package
  • release
  • repository_advisory
  • repository
  • repository_dispatch
  • repository_import
  • repository_vulnerability_alert
  • secret_scanning_alert
  • secret_scanning_alert_location
  • security_advisory
  • security_and_analysis
  • sponsorship
  • star
  • status
  • team_add
  • team
  • watch
  • workflow_dispatch
  • workflow_job
  • workflow_ru
You might also like...
🛡️ Automatically protect the default branch of new repositories in a GitHub organization

The Branch Autoprotector watches a GitHub organization and automatically protects the default branch in new repositories. This service notifies the creator of the default branch of this automatic branch protection setup by filing an issue in the repository.

A language server for lua written in rust

lua-analyzer lua-analyzer is a lsp server for lua. This is mostly for me to learn the lsp protocol and language analysis so suggestions are helpful. T

Unofficial Bitwarden compatible server written in Rust, formerly known as bitwarden_rs

Alternative implementation of the Bitwarden server API written in Rust and compatible with upstream Bitwarden clients*, perfect for self-hosted deploy

Rust 版本的 UnblockNeteaseMusic/server ,以效能、穩定性及可維護性為目標。

【開發中】unm-server-rust Rust 版本的 UnblockNeteaseMusic/server ,以效能、穩定性及可維護性為目標。 安裝 最新版本 下載二進位檔案 前往 Actions 分頁找到 “Build binaries for UNM“,點開後可從 Artifacts 中

Rust implementation for Wlroots (Sway, Wayfire, Hikari, River, etc.) of Gnome Screenshot and Idle DBUS Server, which Upwork uses to capture the screen as proof of work.

🚀 upwork-wlroots-bridge 🚀 Rust Implementation for Wlroots (Sway, Wayfire, Hikari, River, etc.) of Gnome Screenshot and Idle DBUS Server (with extra

Basic ActivityPub Server (in Rust)

Basic ActivityPub Server (in Rust) This is a deep-dive on this blog post: https://blog.joinmastodon.org/2018/06/how-to-implement-a-basic-activitypub-s

A rust(serenity) based discord bot for the hacksquad discord server

A Discord Bot for Hacksquad How to Deploy? Requirements Docker Docker Compose Steps To Run Copy the docker-compose.yml and .env.example files to your

The SATySFi Language Server

[WIP] SATySFi Language Server This repository is work-in-progress yet. Features Kind Function Done codeAction Add the definition of an undefined comma

Locast to Emby/Plex/Channels server

This application provides an interface between locast.org and Media Servers like Plex Media Server (PMS) and Emby by acting like an HDHomerun or an m3u tuner and an XMLTV provider.

Owner
Luca
Luca
🥅 Dead simple webhook worker for Sentry to output events in a Discord channel

?? Sentry Webhook Dead simple webhook worker for Sentry to output events in a Discord channel Why? This is just a simple Rust HTTP service to do so, t

Noel 5 Nov 7, 2022
Lambda function to handle Bitbucket webhook payloads, extract relevant information and send notifications to Microsoft Teams

PR-Bot Lambda function to handle Bitbucket webhook payloads, extract relevant information, and send notifications to Microsoft Teams, saving you time

Irine 14 Sep 26, 2023
Help project managers and project owners with easy-to-understand views of github issue dependencies.

Help project managers and project owners with easy-to-understand views of github issue dependencies.

nasa 56 Dec 15, 2022
Telegram bot help you to run Rust code in Telegram via Rust playground

RPG_BOT (Rust Playground Bot) Telegram bot help you to run Rust code in Telegram via Rust playground Bot interface The bot supports 3 straightforward

TheAwiteb 8 Dec 6, 2022
Bevy plugin to help implement loading states

This is a plugin for the Bevy game engine, to help you implement loading states.

Ida Iyes 70 Jan 7, 2023
Hi I'm Sophy, a discord bot in devlopment, soon I'll be available to help everyone (❁´◡`❁)

Sophy Bot Hi I'm Sophy, a discord bot in devlopment, soon I'll be available to help everyone (❁´◡`❁) Contribution Do you like me and want to help me?

Far Dragi 0 May 30, 2022
A bunch of commented Anchor programs and JavaScript tests, to help me learn Anchor.

learning-anchor A bunch of commented Anchor programs and JavaScript tests, to help me learn Anchor.

Matt Lim 3 Nov 21, 2021
A Github Actions based CI release template for Rust binaries

Rust CI Release Template A Github Actions based CI release template. This repo serves as a live template, and reference for building your own CI power

null 60 Dec 9, 2022
Gathering some metrics about github projects

rust-metrics This is an experimental project to start gathering metrics about github organizations and repositories. The goal is to get an idea of var

null 51 Apr 9, 2022
A GitHub Action to automatically build and deploy your mdbook project.

?? deploy-mdbook The deploy-mdbook action allows you to easily build and deploy your mdBook project to GitHub Pages. See action.yml for configuration

null 27 Oct 24, 2022