https://github.com/peteraritchie/test
https://github.com/peteraritchie/test
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/peteraritchie/test
- Owner: peteraritchie
- Created: 2019-10-25T00:49:08.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-07-09T21:15:45.000Z (over 1 year ago)
- Last Synced: 2025-03-05T00:34:07.599Z (10 months ago)
- Language: C#
- Size: 45.9 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GitHub Permission Surveyor
This tool helps to audit GitHub organizations by producing a report like this:
| repo | repo-state | repo-last-pushed | principal-kind | principal | permission | via-team |
|--------------|------------|------------------|----------------|-----------------------|------------|----------------------------|
| Some repo | public | 10/23/2019 8:30 | team | Some Team | admin | Some Team |
| Some repo | public | 10/23/2019 8:30 | team | Another Team | push | Another Team |
| Some repo | public | 10/23/2019 8:30 | user | Some Owner | admin | (Owner) |
| Some repo | public | 10/23/2019 8:30 | user | Some User | push | Some Team\Some Nested Team |
| Another repo | public | 10/23/2019 3:30 | user | Another Owner | admin | (Owner) |
| Another repo | public | 10/23/2019 3:30 | user | Some User | push | Some Team |
| Another repo | public | 10/23/2019 3:30 | user | Some External User | pull | (Collaborator) |
| Another repo | public | 10/23/2019 3:30 | user | Another External User | push | (Collaborator) |
## Usage
It's a command line app. It will prompt for log in information on first run
so it can create a personal access token (PAT). It needs read-only access to
repos and orgs.
```
$ \.GitHubPermissionSurveyor.exe [output-file]
```
If you don't specify an output file, the app will show the results in Excel. In
case you don't have Excel, you'll get an error before the tool runs and you need
to specify a path for the `.csv` file with the report.
```
$ .\GitHubPermissionSurveyor.exe dotnet C:\work\permissions.csv
```
## Caching
During the first run, the tool will write a cache file, named `cached-org.json`
which will be placed next to `GitHubPermissionSurveyor.exe` so long you request
the same org, the next time the tool runs it won't talk to GitHub.
This is useful if you want to play with the format of the report. However, that
also means that you will keep getting (potentially) stale data. So you might
want to delete the file periodically.
## Markdown export
In case you're a ~~masochist~~ [Markdown fetishist][md], you can also specify
the file extension `.md`, in which case the result is written as a Markdown
table. Feel free to use pivot tables and XLOOKUP...oh wait.
My personal opinion: Excel for life. Don't at me.
[md]: https://twitter.com/timheuer/status/1187405333532033026