Skip to content

Commit 4d0e672

Browse files
committed
readme file updated
1 parent cd3e1da commit 4d0e672

File tree

1 file changed

+47
-1
lines changed

1 file changed

+47
-1
lines changed

README.md

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,53 @@ from .env file, Otherwise app will not work locally.
7979
8080
## Installing the bot on a repository
8181
82-
You'll need to identify a target repository and install the bot by clicking the **Install** button on the settings page of your app, e.g `https://github.com/settings/apps/my-oppiabot-testing-app/installations`. In the `.env` file put your github account name in `WHITELISTED_ACCOUNTS` and also add your repository (name in small caps) in the `constants.js` file locally.
82+
Example Scenario
83+
84+
Suppose you have a GitHub account with the username johndoe, and you want to install a bot on a repository named my-cool-project.
85+
86+
Step-by-Step Guide
87+
1) Select and Install the Bot on Your Repository
88+
89+
a) Visit the settings page for your bot at https://github.com/settings/apps/your-bot-name/installations (replace your-bot-name with your bot's actual name).
90+
b) Here, you’ll see an Install button next to each available repository.
91+
c) Click on Install for your target repository. For example, if my-cool-project is the repository where you want to install the bot, click Install next to it.
92+
93+
2) Add Your Account to the .env File
94+
95+
a) Open the .env file in your project’s local directory. This file stores environment variables needed by your bot.
96+
b) Add your GitHub account name (in this example, johndoe) to the WHITELISTED_ACCOUNTS entry. This allows the bot to recognize and interact with your account.
97+
For example :- WHITELISTED_ACCOUNTS=johndoe
98+
99+
3) Specify Your Repository in constants.js
100+
101+
a) Open constants.js, which stores the bot’s configuration for each repository. Locate the checksWhitelist object, where each repository has its own configuration.
102+
b) Add a new entry for your repository in lowercase (e.g., my-cool-project). Define the specific events and checks the bot should monitor for this repository.
103+
Here’s how you can add my-cool-project to checksWhitelist:
104+
105+
const checksWhitelist = {
106+
// existing configurations for other repositories
107+
'oppia-android': { /* ... */ },
108+
'oppia': { /* ... */ },
109+
'oppiabot': { /* ... */ },
110+
111+
// Add your new repository entry here
112+
'my-cool-project': {
113+
[openEvent]: [claCheck, assigneeCheck, branchCheck],
114+
[reopenEvent]: [branchCheck, mergeConflictCheck],
115+
[PRLabelEvent]: [prLabelCheck],
116+
[synchronizeEvent]: [mergeConflictCheck],
117+
[closeEvent]: [allMergeConflictCheck],
118+
[editEvent]: [wipCheck],
119+
[issuesLabelEvent]: [issuesLabelCheck],
120+
[issuesAssignedEvent]: [issuesAssignedCheck],
121+
[pushEvent]: [forcePushCheck],
122+
[pullRequestReviewEvent]: [pullRequestReviewCheck],
123+
[checkCompletedEvent]: [ciFailureCheck],
124+
[issueCommentCreatedEvent]: [respondToReviewCheck]
125+
}
126+
};
127+
128+
This configuration will allow the bot to monitor specific events and perform actions for my-cool-project.
83129

84130

85131
## Running the bot locally

0 commit comments

Comments
 (0)