bot-scripts contains the program(s) used to install and setup the badging-bot on a user local machine. The major program/script used for this installation is the install.sh script. This script contains the workflow for the badging-bot setup based on the operating system of a user (MacOS, Linux and Windows).
- Install curl
- Local machine user should have sudoprivileges.
- Create an access token (https://github.com/settings/tokens) and save it in local secret file.
- Create a webhook
- Visit https://smee.io
- Click on
Start a new channel - Copy the
Webhook Proxy URLand save in your secrets file. Note:- This URL is what will be required to view the events in later sections.
- This will be supplied on script runtime as the
Webhook URL
- Click on
- Visit https://smee.io
- Setup app:
- Visit https://github.com/settings/apps/new
- Register a new GitHub App (Section)
- GitHub App name:
$your_desired_app_name - Description:
App responsible for event-diversity-and-inclusion badging-bot - Homepage URL (website used by the GitHub App.):
https://handbook.chaoss.community/community-handbook/badging/overview. You can add your desired website of choice here.
- GitHub App name:
- Identifying and authorizing users (Leave as it is)
- Post installation (Leave as it is)
- Webhook
- Webhook URL:
$Webhook_URL - Webhook secret (optional):
$your_secret- Don't forget to store this in your secret file
- SSL verficiation: Enable SSL verification
- Webhook URL:
- Permissions
- Repository permissions
- Set all accesses to Read and Write (28 selected)
- Exceptions:
- Single file set to No Access.
- Metadata access maximimum permission is Read-only.
- Codespaces metadata maximimum permission is Read-only.
- Exceptions:
- Set all accesses to Read and Write (28 selected)
- Organization permissions
- (Leave as it is)
- Account permissions
- (Leave as it is)
- Repository permissions
- Subscribe to events
- Based on the permissions you’ve selected, what events would you like to subscribe to?
- Check all boxes if you would like to.
- Where can this GitHub App be installed? Only on this account
- Based on the permissions you’ve selected, what events would you like to subscribe to?
- Click Create GitHub App
- Register a new GitHub App (Section)
- On the newly created app webpage (https://github.com/settings/apps/$your_desired_app_name)
- Copy the
App IDandClient IDinto your secret file. - Client secrets
- Click
Generate a new client secret- Make sure to copy your new client secret and save in your secret file
- Click
- Private keys
- Click
Generate a private key- This downloads to your local machine with the name,
$appName.$date.private-key.pem. Please move it to a place of easy accessibility and take note of its path (e.g./home/$user/$your_desired_app_name.$date.private-key.pem)
- This downloads to your local machine with the name,
- Click
- (Optional) Display information: Add a cool logo :)
- Leave all previous setting as it is and click Save changes.
- Copy the
- Visit https://github.com/settings/apps/new
$ source <(curl -s https://raw.githubusercontent.com/badging/bot-scripts/main/install.sh)
If the source approach above does not work, an alternative would be to clone this repository and run:
$ chmod +x install.sh
$ bash install.sh
---Runtime arguments---
Enter Github username:
- Access the previously created GitHub App through;
- https://github.com/settings/apps/$appName, or
- Settings >> Developer settings >> GitHub Apps
- While in the https://github.com/settings/apps, from the left menu, click
Install App- Click
Installon your account- Install on your personal account
$Account_Name- Only select repositories
- Select repositories:
$GitHub_Username/event-diversity-and-inclusion
- Select repositories:
- Only select repositories
- Click
Install
- Install on your personal account
- Click
- Return to your terminal and input
yforHave you installed the test app on your forked event-diversity-and-inclusion repository?
Have you installed the test app on your forked event-diversity-and-inclusion repository? (y/n): y
...
[nodemon] 2.0.15
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): *.*
[nodemon] watching extensions: js,mjs,json
[nodemon] starting `node index.js`
info: App listening on PORT:2020