diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..4e829b8 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,15 @@ +--- +name: "test" + +on: + push: + branches: + - 'master' + pull_request: {} + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - run: make test diff --git a/git-secrets b/git-secrets index 484d141..bcf7ac8 100755 --- a/git-secrets +++ b/git-secrets @@ -213,7 +213,7 @@ prepare_commit_msg_hook() { install_hook() { local path="$1" hook="$2" cmd="$3" dest - # Determines the approriate path for a hook to be installed + # Determines the appropriate path for a hook to be installed if [ -d "${path}/hooks/${hook}.d" ]; then dest="${path}/hooks/${hook}.d/git-secrets" else @@ -224,7 +224,8 @@ install_hook() { echo "#!/usr/bin/env bash" > "${dest}" echo "git secrets --${cmd} -- \"\$@\"" >> "${dest}" chmod +x "${dest}" - say "$(tput setaf 2)✓$(tput sgr 0) Installed ${hook} hook to ${dest}" + [ -t 1 ] && command -v tput &> /dev/null && echo -n "$(tput setaf 2)✓$(tput sgr 0) " + echo "Installed ${hook} hook to ${dest}" } install_all_hooks() { diff --git a/test/test_helper.bash b/test/test_helper.bash index cf67b8e..9377b33 100644 --- a/test/test_helper.bash +++ b/test/test_helper.bash @@ -30,7 +30,7 @@ setup_repo() { delete_repo mkdir -p $TEST_REPO cd $TEST_REPO - git init + git init --initial-branch=master git config --local --add secrets.patterns '@todo' git config --local --add secrets.patterns 'forbidden|me' git config --local --add secrets.patterns 'WHITE SPACE'