From 53893cadf661c127fc8a59327ac3b35fa4d3279d Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Wed, 20 Jul 2022 04:11:02 -0400 Subject: [PATCH 1/5] spelling: appropriate Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- git-secrets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-secrets b/git-secrets index 11be153..0e47431 100755 --- a/git-secrets +++ b/git-secrets @@ -194,7 +194,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 From 0652a46d8a02b913104363f8d9f91d7f8f040f7c Mon Sep 17 00:00:00 2001 From: "Clarence \"Sparr\" Risher" Date: Wed, 14 Sep 2022 22:26:08 +0000 Subject: [PATCH 2/5] Explicitly set initial branch for tests --- test/test_helper.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_helper.bash b/test/test_helper.bash index 9133e51..e0e93a2 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 '#hash' From 65891e23f341f159098300999edcce5983cd3ad8 Mon Sep 17 00:00:00 2001 From: Danny Sauer Date: Thu, 13 Oct 2022 13:09:40 -0500 Subject: [PATCH 3/5] Only emit terminal codes to terminal Check for presence of tput and for stdout being a terminal before emitting terminal control codes. Remove unnecessary dependence on `say` --- git-secrets | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/git-secrets b/git-secrets index 11be153..97370ec 100755 --- a/git-secrets +++ b/git-secrets @@ -205,7 +205,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 ] && which tput >/dev/null && echo -n "$(tput setaf 2)✓$(tput sgr 0) " + echo "Installed ${hook} hook to ${dest}" } install_all_hooks() { From 95381872778792ba6b3b25ea4501defc27fc510e Mon Sep 17 00:00:00 2001 From: Danny Sauer Date: Fri, 21 Oct 2022 11:27:32 -0500 Subject: [PATCH 4/5] run tests when PR opened --- .github/workflows/test.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/workflows/test.yml 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 From b9e40d833b028f9bdbe5451c7c0aaf9e713872de Mon Sep 17 00:00:00 2001 From: "Clarence \"Sparr\" Risher" Date: Tue, 20 Jun 2023 21:42:52 +0000 Subject: [PATCH 5/5] Replace which with command in tput check Signed-off-by: Clarence "Sparr" Risher --- git-secrets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-secrets b/git-secrets index 97370ec..8df3809 100755 --- a/git-secrets +++ b/git-secrets @@ -205,7 +205,7 @@ install_hook() { echo "#!/usr/bin/env bash" > "${dest}" echo "git secrets --${cmd} -- \"\$@\"" >> "${dest}" chmod +x "${dest}" - [ -t 1 ] && which tput >/dev/null && echo -n "$(tput setaf 2)✓$(tput sgr 0) " + [ -t 1 ] && command -v tput &> /dev/null && echo -n "$(tput setaf 2)✓$(tput sgr 0) " echo "Installed ${hook} hook to ${dest}" }