Skip to content

Commit a1c38ca

Browse files
committedFeb 8, 2018
ncu-team: add docs
1 parent 5dc41cb commit a1c38ca

File tree

2 files changed

+85
-4
lines changed

2 files changed

+85
-4
lines changed
 

‎README.md

+12-4
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ CLI tools for Node.js Core collaborators.
2626
core, e.g. landing Pull Requests.
2727
- [`ncu-config`](./docs/ncu-config.md): Configure variables for node-core-utils
2828
to use.
29+
- [`ncu-team`](./docs/ncu-team.md): Listing members of a team, synchronizing
30+
special blocks in files with the list of members.
2931

3032
## Usage
3133

@@ -53,14 +55,20 @@ Most of the tools need your GitHub credentials to work. You can either
5355
2. Or, create a personal access token yourself on GitHub, then set them up
5456
using an editor.
5557

58+
5659
If you prefer option 2, [follow these instructions](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/)
5760
to create the token.
5861

59-
Note: We need to read the email of the PR author in order to check if it matches
60-
the email of the commit author. This requires checking the box `user:email` when
61-
you create the personal access token (you can edit the permission later as well).
62+
When creating the token, the following boxes need to be checked:
63+
64+
- `user:email`: Used by `git-node` and `get-metadata` to read the email of the
65+
PR author in order to check if it matches the email of the commit author.
66+
- `read:org`: Used by `ncu-team` to read the list of team members.
67+
68+
You can also edit the permission of existing tokens later.
6269

63-
Then create an rc file (`~/.ncurc` or `$XDG_CONFIG_HOME/ncurc`):
70+
After the token is generated, create an rc file with the following content:
71+
(`~/.ncurc` or `$XDG_CONFIG_HOME/ncurc`):
6472

6573
```json
6674
{

‎docs/ncu-team.md

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# ncu-team
2+
3+
Listing members of a specific team, synchronize special blocks in files with
4+
the list of members.
5+
6+
## Usage
7+
8+
### List the members in a team
9+
10+
The members will be sorted alphabetically by their login.
11+
12+
```
13+
$ ncu-team list automation-collaborators
14+
15+
- [@evanlucas](https://github.com/evanlucas) - Evan Lucas
16+
- [@joyeecheung](https://github.com/joyeecheung) - Joyee Cheung
17+
- [@MylesBorins](https://github.com/MylesBorins) - Myles Borins
18+
- [@nodejs-github-bot](https://github.com/nodejs-github-bot) - Node.js GitHub Bot
19+
- [@rvagg](https://github.com/rvagg) - Rod Vagg
20+
- [@targos](https://github.com/targos) - Michaël Zasso
21+
```
22+
23+
### Synchronize files with special blocks
24+
25+
`ncu-team sync` updates the special block `<!-- ncu-team-sync.team($org/$team) -->`
26+
with a list of members under the specified team.
27+
28+
For example, if there is a file named `README.md` with text like this:
29+
30+
```markdown
31+
## Collaborators in the automation team
32+
33+
<!-- ncu-team-sync.team(nodejs/automation-collaborators) -->
34+
35+
<!-- ncu-team-sync end -->
36+
37+
## Bots in the Node.js organization
38+
39+
<!-- ncu-team-sync.team(nodejs/bots) -->
40+
41+
<!-- ncu-team-sync end -->
42+
```
43+
44+
Running this command:
45+
46+
```
47+
$ ncu-team sync README.md
48+
```
49+
50+
will update the file with text like this:
51+
52+
```markdown
53+
## Collaborators in the automation team
54+
55+
<!-- ncu-team-sync.team(nodejs/automation-collaborators) -->
56+
57+
- [@evanlucas](https://github.com/evanlucas) - Evan Lucas
58+
- [@joyeecheung](https://github.com/joyeecheung) - Joyee Cheung
59+
- [@MylesBorins](https://github.com/MylesBorins) - Myles Borins
60+
- [@nodejs-github-bot](https://github.com/nodejs-github-bot) - Node.js GitHub Bot
61+
- [@rvagg](https://github.com/rvagg) - Rod Vagg
62+
- [@targos](https://github.com/targos) - Michaël Zasso
63+
64+
<!-- ncu-team-sync end -->
65+
66+
## Bots in the Node.js organization
67+
68+
<!-- ncu-team-sync.team(nodejs/bots) -->
69+
70+
- [@nodejs-github-bot](https://github.com/nodejs-github-bot) - Node.js GitHub Bot
71+
72+
<!-- ncu-team-sync end -->
73+
```

0 commit comments

Comments
 (0)
Please sign in to comment.