Sends messages to a Discord webhook whenever you make a new commit to your local git repository.

Overview

Git-Notif

Sends messages to a Discord webhook whenever you make a new commit to your local git repository.

Usage

Just drop notifier.py into your git hooks directory (by default, it's .git/hooks) and rename the file to post-commit. Update post-commit's permissions to allow it to be executable: chmod 755 post-commit.

Optionally, you may use the following installer script to install this script automatically into your git hooks directory:

#!/usr/bin/env bash

CURL_LOC=$(which curl)

if [[ $? -ne 0 ]]; then
    if [[ -z $1 ]]; then
        echo "[ - ] Failed to locate cURL." 1>&2
        echo "[ - ] Make sure cURL is installed and available." 1>&2
        echo "[ - ] Alternatively, you may pass this script a valid location to a cURL binary as it's first argument." 1>&2
        exit 1
    fi

    if [[ $($1 -V | grep -Eo "^curl") != "curl" ]]; then
        echo "[ - ] ${1} is not a valid cURL binary." 1>&2
        exit 1
    fi

    CURL_LOC=$1
fi

if [[ -z $GIT_DIR ]]; then
    GIT_DIR=".git"
fi

# ensure we're inside a git repository.
if [[ $(find . -maxdepth 1 -type d -name $GIT_DIR -printf "%P" | tr -d "\n") != $GIT_DIR ]]; then
    echo "[ - ] No git directory found." 1>&2
    echo "[ - ] Make sure you're inside a git repository." 1>&2
    exit 1
fi

HOOKS_DIR=$(git config core.hooksPath)
if [[ -z $HOOKS_DIR ]]; then
    HOOKS_DIR=$GIT_DIR/hooks
fi

# ensure we have rw perms on the hooks dir.
if [[ ! -r $HOOKS_DIR ]] || [[ ! -w $HOOKS_DIR ]]; then
    echo "[ - ] Unable to access ${HOOKS_DIR}." 1>&2
    exit 1
fi

cd $HOOKS_DIR
$CURL_LOC https://raw.githubusercontent.com/tins2831/git-notif/master/notifier.py --output post-commit

chmod 755 post-commit

echo "[ + ] Installed."

There is a configuration file (.wh_config.json) that's generated at the project level when the tool is first ran. You must edit this file and add your webhook's ID and token:

https://discord.com/api/webhooks/{id}/{token}

Sample

Sample image

Repositório para meu Discord Bot pessoal

BassetinhoBot Escrevi o código usando o Python 3.8.3 e até agora não tive problemas rodando nas versões mais recentes. Repositório para o Discord Bot

Vinícius Bassete 1 Jan 04, 2022
Simple PoC script that allows you to exploit telegram's "send with timer" feature by saving any media sent with this functionality.

Simple PoC script that allows you to exploit telegram's "send with timer" feature by saving any media sent with this functionality.

Matteo 52 Nov 29, 2022
Python + AWS Lambda Hands OnPython + AWS Lambda Hands On

Python + AWS Lambda Hands On Python Criada em 1990, por Guido Van Rossum. "Bala de prata" (quase). Muito utilizado em: Automatizações - Selenium, Beau

Marcelo Ortiz de Santana 8 Sep 09, 2022
A working selfbot for discord

React Selfbot Yes, for real ⚠ "Maintained" version: https://github.com/AquaSelfBot/AquaSelfbot ⚠ Why am I making this open source? Because can't stop

3 Jan 25, 2022
The system to host your files on the Discord application

Distorage The system to host your files on the Discord application Documentation Documentation Distorage How to use the package You can install it wit

6 Jun 27, 2022
A compatability shim between Discord.py and Hikari.

Usage as a partial shim: import discord import hikari import hikari_shim dpy_bot = discord.Client(intents=discord.Intents.all(), enable_debug_events=

EXPLOSION 3 Dec 25, 2021
A bot to view Garfield comics directly from Discord and get updates of the comics automatically

Garfield-Bot A bot to view Garfield comics directly from Discord and get updates of the comics automatically. Instructions to use the bot: Invite the

Raghav Sharma 3 Feb 13, 2022
Moon-TikTok-Checker - A TikTok Username checking tool that probably 3/4 people use to get rare usernames

Moon Checker (educational Purposes Only) What Is Moon Checker? This is a TikTok

glide 4 Nov 30, 2022
Report-snapchat - Report Snapchat acc with python

report-snapchat Report Snapchat acc Report users on Snapchat about the tool : 4

17 Dec 01, 2022
Project made to analyse movie trends

MovieTrends Project to analyse the daily movie trends from the website The Movie DataBase. The main idea is upload the results to a PostgreSQL server

Jazmín López Chacón 0 Feb 15, 2022
Template to create a telegram bot in python

Template for Telegram Bot Template to create a telegram bot in python. How to Run Set your telegram bot token as environment variable TELEGRAM_BOT_TOK

PyTopia 10 Mar 07, 2022
ВКонтакте бот для управления Sugar кошельком

Sugarchain VK ВКонтакте бот для управления Sugar кошельком Установка Установить зависимости можно командой: pip install -r requirements.txt Запуск (из

Vladimir 4 Jun 06, 2021
Video-Player - Telegram Music/ Video Streaming Bot Using Pytgcalls

Video Player 🔥 ᴢᴀɪᴅ ᴠᴄ ᴘʟᴀyᴇʀ ɪꜱ ᴀ ᴛᴇʟᴇɢʀᴀᴍ ᴘʀᴏᴊᴇᴄᴛ ʙᴀꜱᴇᴅ ᴏɴ ᴘʏʀᴏɢʀᴀᴍ ꜰᴏʀ ᴘʟᴀʏ

Zaid 16 Nov 30, 2022
Force-Subscribe-Bot - A Telegram Bot to force users to join a specific channel before sending messages in a group

Introduction A Telegram Bot to force users to join a specific channel before sen

LG Bot Updates 0 Jan 16, 2022
A Bot that Forwards Tweets to Telegram using Airtable as a database.

Twitter Telegram Forward A Bot that Forwards Tweets to Telegram using Airtable as a Database. Features: Handles multiple twitter and telegram channels

George Bakev 3 Dec 21, 2022
Georeferencing large amounts of data for free.

Geolocate Georeferencing large amounts of data for free. Special thanks to @brunodepauloalmeida and the whole team for the contributions. How? It's us

Gabriel Gazola Milan 23 Dec 30, 2022
Male' Map Telegram Bot

Male' Map TelegramBot A simple TelegramBot to fetch residential addresses in Male', Maldives. The bot can be queried inline or directly. sample .env f

Naail Abdul Rahman 12 Nov 25, 2022
Asynchronous multi-platform robot framework written in Python

NoneBot ✨ 跨平台 Python 异步机器人框架 ✨ 文档 · 安装 · 开始使用 · 文档打不开? 简介 NoneBot2 是一个现代、跨平台、可扩展的 Python 聊天机器人框架,它基于 Python 的类型注解和异步特性,能够为你的需求实现提供便捷灵活的支持。

NoneBot 3.1k Jan 04, 2023
A CLI tool to transfer, sync, and backup playlists on music streaming services

unitunes A command-line interface tool to manage playlists across music streaming services. Introduction unitunes manages playlists across streaming s

Victor Tao 50 Jan 07, 2023
The best discord.py template with a changeable prefix

Discord.py Bot Template By noma4321#0035 With A Custom Prefix To Every Guild Function Features Has a custom prefix that is changeable for every guild

Noma4321 5 Nov 24, 2022