You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: toolbox/github/GitHubWizard.sh
+5-3Lines changed: 5 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -14,8 +14,9 @@
14
14
# Description.........: Received from arguments a feature to launch and gives it to the Ruby wizard.
15
15
# Parses the RUBY_CONFIGURATION_FILE to get the GitHub personal acces token to set as Ruby env. variable (OCTOKIT_ACCESS_TOKEN).
16
16
17
-
#set -euxo pipefail
18
-
VERSION="1.5.0"
17
+
set -euo pipefail # set -euxo pipefail
18
+
19
+
VERSION="1.6.0"
19
20
20
21
# Common files
21
22
# ------------
@@ -55,6 +56,7 @@ UsageAndExit(){
55
56
echo -e "\t set-users-permissions-to-push..................: For all projects update each user permission to 'push' except for teams and administrators"
56
57
echo -e "\t set-teams-permissions-to-push..................: For all projects update each team permission to 'push'"
57
58
echo -e "\t set-teams-permissions-to-read..................: For all projects update each team permission to 'read'"
59
+
echo -e "\t downgrade-user-permissions-if-admin............: For all projects update each suer from 'admin' to 'maintain''"
58
60
echo -e "\t backup-all-repositories-from-org...............: Dump all repositories in GitHub to a specific location in the disk"
59
61
echo -e "\t vulnerabilities-alerts-for-all-repositories....: Check if there are vulnerabilities alerts in repositories of the defined organisation"
60
62
echo -e "\t look-for-leaks.................................: Checks with gitleaks if there are leaks in all repositories"
@@ -90,7 +92,7 @@ if [ -z "$feature_to_run" ]; then
90
92
fi
91
93
92
94
# TODO: Refactor this line. Some day. I have a very big screen. Haven't you?
93
-
if [ $feature_to_run!="get-members-2fa-disabled"-a$feature_to_run!="get-all-members"-a$feature_to_run!="get-members-without-company"-a$feature_to_run!="get-projects-without-team"-a$feature_to_run!="get-users-with-bad-email"-a$feature_to_run!="get-users-with-bad-fullname"-a$feature_to_run!="get-projects-conformity"-a$feature_to_run!="get-projects-without-licenses"-a$feature_to_run!="get-empty-projects"-a$feature_to_run!="set-users-permissions-to-push"-a$feature_to_run!="set-teams-permissions-to-push"-a$feature_to_run!="set-teams-permissions-to-read"-a$feature_to_run!="backup-all-repositories-from-org"-a$feature_to_run!="vulnerabilities-alerts-for-all-repositories"-a$feature_to_run!="look-for-leaks" ];then
95
+
if [ $feature_to_run!="get-members-2fa-disabled"-a$feature_to_run!="get-all-members"-a$feature_to_run!="get-members-without-company"-a$feature_to_run!="get-projects-without-team"-a$feature_to_run!="get-users-with-bad-email"-a$feature_to_run!="get-users-with-bad-fullname"-a$feature_to_run!="get-projects-conformity"-a$feature_to_run!="get-projects-without-licenses"-a$feature_to_run!="get-empty-projects"-a$feature_to_run!="set-users-permissions-to-push"-a$feature_to_run!="set-teams-permissions-to-push"-a$feature_to_run!="set-teams-permissions-to-read"-a$feature_to_run!="downgrade-user-permissions-if-admin"-a$feature_to_run!="backup-all-repositories-from-org"-a$feature_to_run!="vulnerabilities-alerts-for-all-repositories"-a$feature_to_run!="look-for-leaks" ];then
94
96
echo"ERROR: '$feature_to_run' is unknown feature. Exit now"
# Using the given Octokit client, for the repository which has that name, adds the user who has this login as a collaborator with the fiven permission level.
261
+
# If the user was already added, just changes its permission level.
262
+
# +octokit_client+:: The Octokit client to use to request the GitHub web API
263
+
# +repository_full_name+:: The full name identifier of the repository to get, like 'organization/project-name'
0 commit comments