mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 19:21:50 +00:00
parent
acabf5e57f
commit
660c755c7e
@ -20,9 +20,16 @@ files=$(git diff --name-only --staged --diff-filter ACMR)
|
||||
function check() {
|
||||
local file="$1"
|
||||
|
||||
if ! grep -qE "(?:(?:\/\/)|(?:#)|(?:--)) ?pre-commit:ignore_sourcegraph_token$" "$file" && grep -qE "s(?:g[psd]|lk)_[0-9a-fA-F]{40,}" "$file" ; then
|
||||
echo "Found a Sourcegraph token in git staged file: $file. Please remove it."
|
||||
exit 1
|
||||
if ! grep -qE "(?:(?:\/\/)|(?:#)|(?:--)) ?pre-commit:ignore_sourcegraph_token$" "$file"; then
|
||||
if grep -qE "s(?:g[psd]|lk)_[0-9a-fA-F]{40,}" "$file"; then
|
||||
echo "Found a Sourcegraph token in git staged file: $file. Please remove it."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if grep -qE "sgph_[a-f0-9]{16}_[a-f0-9]{40}" "$file"; then
|
||||
echo "Found a Sourcegraph token in git staged file: $file. Please remove it."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
if grep -qE "gh[pousr]_[0-9a-zA-Z]{36}" "$file"; then
|
||||
echo "Found a GitHub token in git staged file: $file. Please remove it."
|
||||
|
||||
Loading…
Reference in New Issue
Block a user