Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Git Hook Scripts

Git Hooks are run by Git during specific actions. Follow the instructions below to enable:

Add Git Hooks

Git hooks need to be added to your local repo for each project,

  • Create Symbolic links in .git/hooks/ for git hook scripts you want to use

    1. cd .git/hooks/

    2. ln -s ../../scripts/hooks/<HOOK_NAME>.sh <HOOK_NAME>

    pre-commit

    • enforces that the branch name matches style: <prefix>/<feature_name>
    • enforces that branch is not main or develop or prefixed with release

    commit-msg

    • enforces that first line of commit message matches conventional commit (ish) style <type>:<description>

    pre-push

    • enforces that the branch name matches style: <prefix>/<feature_name>

    post-commit

    • warns when changes are getting large since "last merge"
      • 25 files
      • 400 lines

Note: Prefix comes from prefix-lis.sh script, which defines defaults and uses the .github/labels.yaml file

Ideas for Hooks

  • Ensure Program Compiles before commit
  • Run tests before commit
    • only if code files touched?
    • only run tests affected by code files modified?
  • Prevent Commit based on Github Branch protections
  • Server side hooks
    • on receive, deploy newest changes