Skip to content

Validate Git commit authors against GitLab group members during pushes to Git repository

License

Notifications You must be signed in to change notification settings

mrts/validate-git-commit-authors-against-gitlab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

validate-authors.py

Validate Git commit authors against GitLab group members during pushes to Git repository. See discussion in Stack Overflow for context.

Copy validate-authors.py to custom_hooks/pre-receive in a GitLab server-side Git repository and make it executable, See GitLab custom Git hooks docs for detailed installation instructions.

When using with SubGit, do the following:

  1. Copy the script to custom_hooks/validate-authors.py
  2. chmod 755 custom_hooks/validate-authors.py
  3. Test by running ./custom_hooks/validate-authors.py
  4. Enable it in existing pre-receive hook (which already contains SubGit code) by adding the following lines to the top before SubGit code:
# -- START changes for SubGit --

# !!! move this line from below !!!
HOOK_INPUT=$(cat)

set -e
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
echo "$HOOK_INPUT" | $SCRIPT_DIR/validate-authors.py
set +e

# -- END changes for SubGit --

About

Validate Git commit authors against GitLab group members during pushes to Git repository

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages