Skip to content

Commit 0975aee

Browse files
authored
doc: document how to request a token with github-nodejs-bot (#894)
Document how to request a fine-grained token with github-nodejs-bot's name. After this landed, github-nodejs-bot tokens that are not fine-grained tokens like https://github.com/nodejs/docker-node/blob/main/.github/workflows/automatic-updates.yml#L28 may be updated to be fine-grained tokens.
1 parent 6e22214 commit 0975aee

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ Groups are created in 1Password with a 1:1 mapping of Node.js organization teams
5555

5656
- **Social Team:** For the [Social Team](#social-team) to contain official account credientials.
5757

58+
## @nodejs-github-bot
59+
60+
Follow the steps in [request-an-access-token](./request-an-access-token.md) to request an access token under the name of [`@nodejs-github-bot`][].
61+
5862
## Node.js Project Calendar
5963

6064
A calendar of the project's meetings can be found at:
@@ -79,3 +83,5 @@ This list should be reviewed and pruned annually (at minimum). The calendar has
7983
- [@MylesBorins](https://github.com/MylesBorins) - **Myles Borins**
8084
- [@ruyadorno](https://github.com/ruyadorno) - **Ruy Adorno**
8185
- [@trott](https://github.com/trott) - **Rich Trott**
86+
87+
[`@nodejs-github-bot`]: https://github.com/nodejs-github-bot

request-an-access-token.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Request a nodejs-github-bot token
2+
3+
Automation in the `nodejs` GitHub Organization may require access tokens to
4+
access permission scoped endpoints. In the case of such requirement, the access
5+
token can be requested to be created under the name of [`@nodejs-github-bot`][].
6+
7+
Creating classic tokens for [`@nodejs-github-bot`][] is not permitted, only
8+
fine-grained tokens are allowed.
9+
10+
To create a fine-grained access token for [`@nodejs-github-bot`][], follow the
11+
steps as:
12+
13+
1. Submit a PR to add the requested repo in the registry below, and describe
14+
expected permission scopes.
15+
1. A TSC member or a build WG member (who has access to the [`@nodejs-github-bot`][]
16+
account) needs to take following action:
17+
1. Create the fine-grained token at https://github.com/settings/personal-access-tokens/new
18+
in the account [`@nodejs-github-bot`][], with "Resource owner" to be
19+
`nodejs`, "Only select repositories" to be the requested repository,
20+
and requested permission scopes only.
21+
1. Save the token as a repository secret at `https://github.com/<org>/<repo>/settings/secrets/actions`,
22+
do not reveal the token to the anyone in plaintext.
23+
1. Land the PR.
24+
25+
Fine-grained tokens created with access to https://github.com/nodejs resources will
26+
be audited at https://github.com/organizations/nodejs/settings/personal-access-tokens/active.
27+
28+
## Registry
29+
30+
The "repo" is a string of the GitHub `<owner>/<repo>`. Generally, the token should
31+
only be created for repo in the https://github.com/nodejs organization.
32+
33+
The "secret name" is a string that the secret can be referenced in the GitHub Action
34+
scripts. Like a secret name of `RELEASE_PLEASE_TOKEN` can be accessed from the script
35+
as `${{ secrets.RELEASE_PLEASE_TOKEN }}`.
36+
37+
Repo | Secret name
38+
--- | ---
39+
nodejs/import-in-the-middle | RELEASE_PLEASE_GITHUB_TOKEN
40+
41+
42+
[`@nodejs-github-bot`]: https://github.com/nodejs-github-bot

0 commit comments

Comments
 (0)