Skip to content

Commit

Permalink
fix input (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
admiralAwkbar authored May 10, 2022
1 parent 7f549c1 commit fa82f63
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,30 @@ You need to either export these environment variables:

Or the script will prompt you to put in the relevant information.

## CLI options

```text
Usage: gh repo-stats [options]
Options:
-h, --help : Show script help
-d, --debug : Enable Debug logging
-u, --url : Set GitHub URL (e.g. https://github.example.com) Looks for GHE_URL environment
variable if omitted or defaults to https://github.com
-i, --input : Set path to a file with a list of organizations to scan, one per line, newline delimited
-t, --token : Set Personal Access Token with repo scope - Looks for GITHUB_TOKEN environment
variable if omitted
-r, --analyze-repo-conflicts : Checks the Repo Name against repos in other organizations and generates a list
of potential naming conflicts if those orgs are to be merged during migration
-T, --analyze-team-conflicts : Gathers each org's teams and checks against other orgs to generate a list of
potential naming conflicts if those orgs are to be merged during migration
-p, --repo-page-size : Set the pagination size for the initial repository GraphQL query - defaults to 20
If a timeout occurs, reduce this value
-e, --extra-page-size : Set the pagination size for subsequent, paginated GraphQL queries - defaults to 20
If a timeout occurs, reduce this value
-o, --org : Name of the GitHub Organization to be analyzed
-O, --output : Determine the output. Can either be "CSV" or "Table" Default: CSV
```
## How to run

Make sure you followed prerequisites and then follow these instructions.
Expand Down
6 changes: 2 additions & 4 deletions gh-repo-stats
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,7 @@ Options:
-d, --debug : Enable Debug logging
-u, --url : Set GitHub URL (e.g. https://github.example.com) Looks for GHE_URL environment
variable if omitted or defaults to https://github.com
-i, --input : Set path to a file with a list of organizations to scan, with the syntax of
an Org Statistics csv
exported from https://github.example.com/stafftools/reports
-i, --input : Set path to a file with a list of organizations to scan, one per line, newline delimited
-t, --token : Set Personal Access Token with repo scope - Looks for GITHUB_TOKEN environment
variable if omitted
-r, --analyze-repo-conflicts : Checks the Repo Name against repos in other organizations and generates a list
Expand Down Expand Up @@ -555,7 +553,7 @@ CheckAdminRights() {
GetOrgsFromFile() {
# shellcheck disable=SC2034
# Unused variables left for readability
while IFS=, read -r id created_at login email admin_ct member_ct team_ct repo_ct sfa_required
while IFS=, read -r login
do
ORG_NAME="${login}"

Expand Down

0 comments on commit fa82f63

Please sign in to comment.