Issue-mafia - An out-of-the-box CLI that helps you to easily synchronize Git hooks with a remote repository

Welcome to issue-mafia!

issue-mafia is an out-of-the-box CLI that helps you to easily synchronize Git hooks with a remote repository. You can learn more about Git hooks here.

Getting started

Installing issue-mafia via Go CLI

To install issue-mafia Go binary, run:

go install github.com/thzoid/issue-mafia

Using the help command

To see a list of available commands, run:

issue-mafia --help

Synchronizing Git hooks

Setting up a configuration repository

To get started with Git hooks synchronization, a GitHub repository containing every hook to be shared with other repositories needs to be created.

issue-mafia will only be able to fetch hooks if the repository is public.

On a configuration repository, hooks need to be placed at the root directory. Each script file should be named after the hook they correspond, without extension. For example, if the Git hooks commit-msg and post-commit were to be synchronized across repositories, the directory structure would look like this:

my-own-hooks/
├─ commit-msg
├─ post-commit

Then, the GitHub repository could be initialized through the following workflow:

/my-own-hooks.git git push -u origin main">
cd my-own-hooks
git init
git add .
git commit -m "add msg and post-commit hooks"
git remote add origin [email protected]:
   
    /my-own-hooks.git
git push -u origin main

   

If issue-mafia is being used within an organization, it is recommended to create this repository using the organization's own GitHub account.

Setting up synchronization on repository

To tell issue-mafia that a specific repository needs to have its hooks synchronized with a remote repository, use the following command:

issue-mafia init

After completing the configuration file creation wizard and providing a valid issue-mafia configuration repository (explained in the previous step), an .issue-mafia file is going to be generated, and this repository is ready to have its hooks fetched from the specified remote origin.

Synchronizing hooks

To synchronize (or update) hooks on a single repository, the directory should have a folder structure similar to the following:

my-local-repo/
├─ .issue-mafia
├─ ...

In that case, just run the root command, and the hooks will be synchronized with the remote repository:

cd my-local-repo
issue-mafia

However, when many repositories have to be synchronized at once, the repositories folder structure might be similar to this one:

my-repos/
├─ foo-repo/
│  ├─ .issue-mafia
│  ├─ ...
├─ bar-repo/
│  ├─ .issue-mafia
│  ├─ ...
├─ ...

In that case, the base command can be executed using the --recursive flag, and issue-mafia will automatically search for repositories in sub-folders:

cd my-repos
issue-mafia --recursive

Always make sure that the repositories that provide Git hooks (shell scripts) are trustworthy.

Collaborating

Any person is invited to collaborate with issue-mafia. Just open a Pull Request and we will review it as soon as possible.

Owner
Thiago
21yo computer scientist, backend (golang ftw) developer at @avenuesec. obsessed by ternary computing and cryptography.
Thiago
Similar Resources

Allows you to use the magic remote on your webOS LG TV as a keyboard/mouse for your Linux machine

magic4linux Allows you to use the magic remote on your webOS LG TV as a keyboard/mouse for your PC Linux machine. This is a Linux implementation of th

Nov 25, 2022

CLI for SendGrid, which helps in managing SSO users, can install and update users from yaml config

Sendgrid API This script is needed to add new users to SendGrid as SSO teammates. Previously, all users were manually added and manually migrating the

Jul 20, 2022

A CLI Tool to easily generate your Terraform configuration

Tf Tf is a command line tool to easily generate your Terraform configuration with an interactive prompt. Inspiration Boredom in Covid-19 Installation

Sep 30, 2022

A small CLI tool to check connection from a local machine to a remote target in various protocols.

CHK chk is a small CLI tool to check connection from a local machine to a remote target in various protocols.

Oct 10, 2022

News-parser-cli - Simple CLI which allows you to receive news depending on the parameters passed to it

News-parser-cli - Simple CLI which allows you to receive news depending on the parameters passed to it

news-parser-cli Simple CLI which allows you to receive news depending on the par

Jan 4, 2022

git-xargs is a command-line tool (CLI) for making updates across multiple Github repositories with a single command.

git-xargs is a command-line tool (CLI) for making updates across multiple Github repositories with a single command.

Table of contents Introduction Reference Contributing Introduction Overview git-xargs is a command-line tool (CLI) for making updates across multiple

Dec 31, 2022

Bit is a modern Git CLI

Bit is a modern Git CLI

bit is an experimental modernized git CLI built on top of git that provides happy defaults and other niceties: command and flag suggestions to help yo

Dec 28, 2022

Interactive CLI helper for creating git branches with JIRA Links and some text

bb (better-branch) Interactive CLI helper for creating git branches with JIRA Links and some text Still in development? Yes How it works? This tiny ut

Aug 18, 2022

git-xargs is a command-line tool (CLI) for making updates across multiple GitHub repositories with a single command

git-xargs is a command-line tool (CLI) for making updates across multiple GitHub repositories with a single command

git-xargs is a command-line tool (CLI) for making updates across multiple GitHub repositories with a single command. You give git-xargs:

Feb 5, 2022
A CLI to replace your git commit command, so your git message can partially follow the Conventional Changelog ecosystem
A CLI to replace your git commit command, so your git message can partially follow the Conventional Changelog ecosystem

COMMIT CLI A CLI to replace your git commit command, so your git message can partially follow the Conventional Changelog ecosystem. And yes, it is bui

Feb 9, 2022
A dead simple CLI tool that prints the next semantic version based on the last tag of your git repository

nextver A dead simple CLI tool that prints the next semantic version based on the last tag of your git repository. Install go install github.com/junk1

Sep 29, 2022
Git-reviewers - Find out who are the best reviewers for a given change.

git-reviewers Figure out who would be a good reviewer for a change. There are two places checked when determining reviewers: The results of git blame

Jan 10, 2022
Find out which organisations are best represented in a repository
Find out which organisations are best represented in a repository

Prop-rep A golang command line tool to show you which organisations are contribu

Sep 30, 2022
Slack remote terminal - execute commands on remote host using slack slash command

slackRT Slack remote terminal - execute commands on remote host using slack slash command Installation Go to api.slack.com/apps and sign in and create

Jul 12, 2022
Ghissue - This repo contains a github issue parser, that is useful for Enterprise Github accounts.

Ghissue - This repo contains a github issue parser, that is useful for Enterprise Github accounts. Sometimes is needed to parse the content of the issue for some data extraction or statistics purposes.

Feb 6, 2022
A dead simple cli utility to help you manage your git stash
A dead simple cli utility to help you manage your git stash

A dead simple cli utility to help you manage your git stash.

Aug 2, 2022
git-glimpse is a command-line tool that is aimed at generating a git prompt like the one from zsh-vcs-prompt.

Git GoGlimpse git-glimpse is a command-line tool that is aimed at generating a git prompt like the one from zsh-vcs-prompt. The particularity of this

Jan 27, 2022
A simple single-file executable to pull a git-ssh repository and serve the web app found to a self-contained browser window

go-git-serve A simple single-file executable to pull a git-ssh repository (using go-git library) and serve the web app found to a self-contained brows

Jan 19, 2022
kubeaudit helps you audit your Kubernetes clusters against common security controls

kubeaudit helps you audit your Kubernetes clusters against common security controls

Dec 30, 2022