Skip to content

Commit 58bd244

Browse files
committed
enh: more details to bot setup
1 parent b1e981d commit 58bd244

File tree

1 file changed

+54
-28
lines changed

1 file changed

+54
-28
lines changed

src/content/docs/development/local-deploy.mdx

Lines changed: 54 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -28,24 +28,32 @@ To get your app running against GitHub:
2828
[developer settings](https://github.com/settings/developers)
2929
- Create a [new GitHub app](https://github.com/settings/apps/new)
3030

31-
Required fields are:
31+
When creating your app, the fields that are required to fill out are:
3232

33-
- `name`, which can be whatever you like, globally unique on GitHub
34-
- `homepage url`, which can be set to anything
35-
- `webhook url`, which can be set to anything
33+
- **name:** Set this to any name that you like. It needs to be a globally
34+
unique name on GitHub
35+
- **homepage url:** Set this to anything (e.g. allcontributors.org is fine)
36+
- **webhook url:** This also can be set to anything.
3637

37-
Important fields are:
38+
The fields below also need to be filled out and the values are important:
3839

39-
- `webhook secret`, set this to `development`
40-
- `Permissions` which should be set
41-
[as defined in the app.yml](https://github.com/all-contributors/all-contributors-bot/blob/main/app.yml#L54),
42-
e.g. set read & write for `Repository contents`, `Issues` and
43-
`Pull Requests`, and read for `Repository Metadata`
44-
- `Subscribe to Events` which should be set
40+
- Set **webhook secret**: to `development`
41+
- Set **Permissions** to the permissions [defined in the app.yml file:}
42+
(https://github.com/all-contributors/all-contributors-bot/blob/main/app.yml#L54),
43+
- **Repository contents:** Set to `read & write`
44+
- Set **Issues** to read
45+
- Set **Pull Requests** to read
46+
- Set **Repository Metadata** to read
47+
48+
\_Note that some of the settings in the `app.yml` file are commented out.\*
49+
50+
Next:
51+
52+
- `Subscribe to Events` should be set
4553
[as defined in the app.yml](https://github.com/all-contributors/all-contributors-bot/blob/main/app.yml#L15),
46-
e.g. check the checkbox for `Issue comment`
47-
- Ensure `Where can this GitHub App be installed?` is set to
48-
`only this account`
54+
- Check the checkbox to subscribe to the **Issue comment** event
55+
- Ensure **Where can this GitHub App be installed?** is set to **only this
56+
account**
4957

5058
<Picture
5159
src={appInstalled}
@@ -55,33 +63,51 @@ Important fields are:
5563

5664
## 2. Configure Your GitHub App for testing
5765

58-
You should now have an app created
66+
You should now have create an app! Now it's time to configure it.
67+
68+
<Picture
69+
src={appCreated}
70+
formats={["avif", "webp"]}
71+
alt="A screenshot that shows the bottom part of the app configuration page with the question, Where can this GitHub app be installed? The option Only on this account is selected."
72+
/>
73+
74+
On the app page, you will notice a side bar with several tabs including
75+
General, Permissions & Webhooks, and Install App.
76+
77+
- On the General Tab of your configured app.
78+
79+
- scroll down to the **Private Keys** section and click the **Generate
80+
Private Key** green button. This will trigger a .pem file to be created and
81+
will download it to your computer (likely to your Downloads directory).
82+
- Move this file so you can retrieve it later.
83+
- Call it something like `allcontributorsbot.pem`.
5984

60-
<Picture src={appCreated} formats={["avif", "webp"]} alt="A screenshot ...." />
85+
- Next, click on the Install App tab. Install the app/bot on your user
6186

62-
- On the General Tab, Click `Generate Private Key` and download it for later
63-
usage, call it something like `allcontributorsbot.pem`
64-
- On the Install Tab, Install the app/bot on your user
87+
**IMPORTANT**: Create a new repository for testing the bot; Then you can
88+
install the app on that repository only. This is important to avoid the bot
89+
interfering with other repositories you may have.
6590

6691
## 3. Configure Your local to talk to the GitHub app
6792

68-
Create a file named `.env` with the following template:
93+
Now that your app is created, you need to configure your local environment.
94+
Create a file named `.env` using the following template:
6995

7096
```txt
7197
APP_ID=
7298
WEBHOOK_SECRET=development
7399
PRIVATE_KEY=
74100
```
75101

76-
### Values
102+
### .env file values
77103

78-
- `APP_ID`, you can get this from the General tab on the developer settings for
79-
your app
80-
- `WEBHOOK_SECRET`, leave as development (you set this on app setup)
81-
- `PRIVATE_KEY` when you generated the private key from your app, you should
82-
have a `allcontributorsbot.pem` file locally (or similar). run
83-
`openssl base64 < allcontributorsbot.pem | tr -d '\n' | pbcopy` on the file
84-
which will copy the base64 contents onto your clipboard, paste that into the
104+
- `APP_ID`: The app ID is a 7 digit numeric value. You can find it on the General tab of the developer settings
105+
for your app.
106+
- `WEBHOOK_SECRET`: Leave this value as `development` (you set it to development when you created your app on GitHub)
107+
- `PRIVATE_KEY`: This key is stored in your .pem file that you downloaded above. To access the value stored in the file:
108+
* CD to the `allcontributorsbot.pem.pem` file (or whatever you called it when you downloaded it above) in your favorite shell.
109+
* run `openssl base64 < allcontributorsbot.pem | tr -d '\n' | pbcopy` on the file. This
110+
will copy the base64 file contents onto your clipboard. Paste that value into the
85111
line for `PRIVATE_KEY`
86112

87113
## 4. Setup a test GitHub repository/with issues PR

0 commit comments

Comments
 (0)