Skip to content

Commit

Permalink
Merge pull request #2 from cloudbees/upstream__master
Browse files Browse the repository at this point in the history
sync up with https://github.com/awslabs/git-secrets latest changes
  • Loading branch information
maxi-bee authored Jun 4, 2024
2 parents a79dbf2 + dd0b192 commit f639503
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -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
5 changes: 3 additions & 2 deletions git-secrets
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion test/test_helper.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit f639503

Please sign in to comment.