Skip to content

Commit df5794d

Browse files
committed
adding descriptions to scripts
1 parent a982b70 commit df5794d

16 files changed

+49
-19
lines changed

scripts/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ Delete branch protection rules programmatically based on a pattern.
7070

7171
## delete-repos-from-list.sh
7272

73+
Deletes a list of repositories.
74+
7375
1. Run: `./generate-repos-list.sh <org> > repos.csv`
7476
2. Clean up the `repos.csv` file and remove the repos you **don't want to delete**
7577
3. Run `./delete-repos-from-list.sh repos.csv`

scripts/add-codeowners-file-to-repositories.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/bin/bash
2-
# DOT NOT REMOVE TRAILING NEW LINE IN THE INPUT CSV FILE
32

4-
# Need to run this to get the repo delete scope: gh auth refresh -h github.com -s delete_repo
3+
# Adds a CODEOWNERS file to the default branch in a CSV list of repositories
54

65
# Usage:
76
# Step 1: Run ./generate-repos.sh <org> > repos.csv
8-
# (or create a list of repos in a csv file, 1 per line, with a trailing empty line at the end of the file)
7+
# - Or create a list of repos in a csv file, 1 per line, with a trailing empty line at the end of the file
8+
# - DO NOT REMOVE TRAILING NEW LINE IN THE INPUT CSV FILE
99
# Step 2: ./add-codeowners-file-to-repositories.sh repos.csv ./CODEOWNERS false
1010
#
1111
# Overwrite or append:

scripts/add-gitignore-file-to-repositories.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/bin/bash
2-
# DOT NOT REMOVE TRAILING NEW LINE IN THE INPUT CSV FILE
32

4-
# Need to run this to get the repo delete scope: gh auth refresh -h github.com -s delete_repo
3+
# Adds a .gitignore file to the default branch in a CSV list of repositories
54

65
# Usage:
76
# Step 1: Run ./generate-repos.sh <org> > repos.csv
8-
# (or create a list of repos in a csv file, 1 per line, with a trailing empty line at the end of the file)
7+
# - Or create a list of repos in a csv file, 1 per line, with a trailing empty line at the end of the file\
8+
# - DO NOT REMOVE TRAILING NEW LINE IN THE INPUT CSV FILE
99
# Step 2: ./add-gitignore-file-to-repositories.sh repos.csv ./.gitignore false
1010
#
1111
# Overwrite or append:

scripts/add-users-to-team-from-list.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
#!/bin/bash
2-
# DOT NOT REMOVE TRAILING NEW LINE IN THE INPUT CSV FILE
2+
3+
# Adds users to an organization team from a CSV input list
34

45
# Usage:
56
# Step 1: Create a list of users in a csv file, 1 per line, with a trailing empty line at the end of the file
7+
# - DO NOT REMOVE TRAILING NEW LINE IN THE INPUT CSV FILE
68
# Step 2: ./add-users-to-team-from-list.sh users.csv <org> <team>
79

810
if [ $# -lt "3" ]; then

scripts/create-enterprise-organizations.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#!/bin/bash
2-
# DOT NOT REMOVE TRAILING NEW LINE IN THE INPUT CSV FILE
2+
3+
# Creates organizations in an enterprise from a CSV input list (orgs-to-create.csv)
4+
5+
# DO NOT REMOVE TRAILING NEW LINE IN THE INPUT CSV FILE
36

47
# Use ../gh-cli/get-enterprise-id.sh to get the enterprise id to use here
58

scripts/create-teams-from-list.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
#!/bin/bash
2-
# DOT NOT REMOVE TRAILING NEW LINE IN THE INPUT CSV FILE
2+
3+
# Creates teams in an organization from a CSV input list
34

45
# Need to run this to be able to create teams: gh auth refresh -h github.com -s admin:org
56

67
# Usage:
78
# Step 1: Create a list of teams in a csv file, 1 per line, with a trailing empty line at the end of the file
8-
# - child teams should have a slash in the name, e.g. test1-team/test1-1-team
9-
# - build out the parent structure in the input file before creating the child teams;
10-
# e.g. have the 'test1-team' come before 'test1-team/test1-1-team' in the file
9+
# - child teams should have a slash in the name, e.g. test1-team/test1-1-team
10+
# - build out the parent structure in the input file before creating the child teams;
11+
# e.g. have the 'test1-team' come before 'test1-team/test1-1-team' in the file
12+
# - DO NOT REMOVE TRAILING NEW LINE IN THE INPUT CSV FILE
1113
# Step 2: ./create-teams-from-list.sh teams.csv <org>
1214

1315
# Example input file:
@@ -16,7 +18,7 @@
1618
# test22-team
1719
# test11-team/test11111-team
1820
# test11-team/test11111-team/textxxx-team
19-
21+
#
2022

2123
if [ $# -lt "2" ]; then
2224
echo "Usage: $0 <teams-file-name> <org>"

scripts/delete-repos-from-list.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
#!/bin/bash
2-
# DOT NOT REMOVE TRAILING NEW LINE IN THE INPUT CSV FILE
2+
3+
# Deletes repos from a CSV input list
34

45
# Need to run this to get the repo delete scope: gh auth refresh -h github.com -s delete_repo
56

67
# Usage:
78
# Step 1: Run ./generate-repos.sh <org> > repos.csv
8-
# (or create a list of repos in a csv file, 1 per line, with a trailing empty line at the end of the file)
9+
# - Or create a list of repos in a csv file, 1 per line, with a trailing empty line at the end of the file
10+
# - DO NOT REMOVE TRAILING NEW LINE IN THE INPUT CSV FILE
911
# Step 2: ./delete-repos-from-list.sh repos.csv
1012

1113
if [ $# -lt "1" ]; then

scripts/delete-teams-from-list.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
#!/bin/bash
2-
# DOT NOT REMOVE TRAILING NEW LINE IN THE INPUT CSV FILE
2+
3+
# Deletes teams in an organization from a CSV input list
34

45
# Need to run this to be able to delete teams: gh auth refresh -h github.com -s admin:org
56

67
# Usage:
78
# Step 1: Create a list of teams in a csv file, 1 per line, with a trailing empty line at the end of the file
8-
# - child teams should have a slash in the name, e.g. test1-team/test1-1-team
9-
# - !!! Important !!! Note that if a team has child teams, all of the child teams will be deleted as well
9+
# - child teams should have a slash in the name, e.g. test1-team/test1-1-team
10+
# - !!! Important !!! Note that if a team has child teams, all of the child teams will be deleted as well
11+
# - DO NOT REMOVE TRAILING NEW LINE IN THE INPUT CSV FILE
1012
# Step 2: ./delete-teams-from-list.sh teams.csv <org>
1113

1214
# Example input file:

scripts/gei-clean-up-azure-storage-account.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/bash
22

3+
# Cleans up containers from a storage account older than a specified time
4+
35
# modified from https://learn.microsoft.com/en-us/azure/storage/scripts/storage-blobs-container-delete-by-prefix-cli#run-the-script
46
# requires GNU date.
57
# if using a mac: `brew install coreutils`

scripts/generate-repos-list.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/bash
22

3+
# Generates a list of repositories in an organization to a CSV file
4+
35
# Usage: ./generate-repos.sh <org> > csv.csv
46

57
# Credits to @tspascoal from this repo: https://github.com/tspascoal/dependabot-alerts-helper

0 commit comments

Comments
 (0)