Skip to content

Commit 064f794

Browse files
committed
Initial commit
1 parent 2ae3585 commit 064f794

8 files changed

+10967
-1
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.csv
2+
node_modules/

README.md

+60-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,60 @@
1-
# repo-owners-report
1+
# Repo Owners Report
2+
3+
## Inputs
4+
5+
### `org-token`
6+
7+
A GitHub personal access token with `org:admin` scopes. Add this to the repository as a secret named `ORG_TOKEN`
8+
9+
### `org-name`
10+
11+
GitHub Org Name. The token generated in Step 1 must have org admin rights over this org.
12+
13+
## Outputs
14+
15+
Generates a CSV file with the name `{org-name}-repo-owners-report.csv`
16+
17+
## Example Usage
18+
19+
```yml
20+
name: Repo Owners report
21+
22+
on:
23+
workflow_dispatch:
24+
inputs:
25+
org-name:
26+
description: 'Org Name'
27+
required: true
28+
29+
jobs:
30+
call-repo-owners:
31+
runs-on: ubuntu-latest
32+
name: Repo Owners
33+
steps:
34+
- id: run-script
35+
uses: rohitnb/repo-owners-report@main
36+
with:
37+
github-org-token: ${{ secrets.ORG_TOKEN }}
38+
org-name: ${{ github.event.inputs.org-name }}
39+
- uses: actions/upload-artifact@v3.1.3
40+
with:
41+
name: repo-owners-report
42+
path: ${{ github.event.inputs.org-name }}-repo-owners-report.csv
43+
44+
```
45+
46+
## Local Testing
47+
48+
Set the environment variables `ORG_TOKEN`` and `ORG_NAME`
49+
50+
```sh
51+
export ORG_TOKEN=ghp_************
52+
export ORG_NAME=org-a
53+
```
54+
55+
Run the script
56+
```sh
57+
node src/index.js
58+
```
59+
60+
`{org-name}-repo-owners-report.csv` will be generated locally

action.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: 'Repo owners report'
2+
description: 'Get the repo owners of your organization'
3+
inputs:
4+
org-token:
5+
description: 'GitHub Token with Org permissions'
6+
required: true
7+
org-name:
8+
description: 'Org Name'
9+
required: true
10+
11+
runs:
12+
using: 'node16'
13+
main: 'dist/index.js'

0 commit comments

Comments
 (0)