-
Notifications
You must be signed in to change notification settings - Fork 35
/
build-testcase-push-protection
executable file
·55 lines (44 loc) · 1.69 KB
/
build-testcase-push-protection
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
normal=$(tput sgr0)
highlight=$(tput setaf 2)
printf "$highlight"
cat << EOF
________ ____
/_ __/ /_ ___ / __ \____ _ _____ _____
/ / / __ \/ _ \ / /_/ / __ \ | /| / / _ \/ ___/
/ / / / / / __/ / ____/ /_/ / |/ |/ / __/ /
/_/ /_/ /_/\___/ /_/ \____/|__/|__/\___/_/
The world's fastest demo of Push Protection
EOF
printf "${normal}"
printf "${highlight} - Creating repo: ${normal}"
./create-repo-testrepo.sh | jq -r '.name'
sleep 5
printf "${highlight} - Enable push protection on repo: ${normal}"
./enable-push-protection.sh | jq -r '.security_and_analysis.secret_scanning_push_protection.status'
./add-team-to-repo.sh
printf "${highlight} - Creating webhook: ${normal}"
./create-webhook.sh | jq -r '.id'
printf "${highlight} - Creating docs/README.md: ${normal}"
./create-commit-readme.sh | jq -r ".content.html_url"
echo
echo "------------ security and analysis settings ------------------"
./list-repo.sh 2>/dev/null | jq -r '.security_and_analysis'
echo "=============================================================="
echo "Cloning the repo to directory src/"
echo
./clone-default-repo.sh >/dev/null 2>&1
echo
echo
echo "Now you need to run:"
echo
echo " ./test-commit-secret.sh"
echo
echo
echo "This will commit a number of common secrets locally"
echo "and attempt to push them to the repo."
echo
echo "If you are here you are probably going to want read about:"
echo
echo "https://docs.github.com/en/enterprise-cloud@latest/code-security/secret-scanning/troubleshooting-secret-scanning-and-push-protection/troubleshooting-secret-scanning#push-protection-limitations"
echo
echo