From 0dd314c051ded64be505f29c8c8830b5369dfa99 Mon Sep 17 00:00:00 2001 From: Flying-Pegasus Date: Wed, 11 Dec 2024 09:32:15 +0530 Subject: [PATCH] Fix #336: provided a clear description of where to add the repo name in the constants.js file. (#340) * Update README.md Provided a clear description of where to add the repo name in the constant.js file. * Updated README.md as per maintainer's feedback corrected constant.js to constants.js * Updated README.md as per maintainer's feedback Solved the changes raised by the maintainer * Updated README.md as per maintainer's feedback Added line above point 2 and 3 in the "Installing the bot on a repository" section --- README.md | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9cdc0853..7530bb6c 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,40 @@ from .env file, Otherwise app will not work locally. ## Installing the bot on a repository -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. + +1. 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`** + +2. Update the **`.env` file**: + - Add your GitHub account name to `WHITELISTED_ACCOUNTS`. + +3. Add the repository name in the **`constants.js` file**: + - Open the **`constants.js`** file in the bot's source code. + - Navigate to the `checksWhitelist` object. + - Add a new entry with your repository name (in lowercase) as the key. The value should define the checks and events specific to your repository. + + **Example:** + If your repository name is `my-repo`, the `checksWhitelist` object will look like this: + ```javascript + const checksWhitelist = { + // Existing entries... + 'my-repo': { + [openEvent]: [claCheck], + [reopenEvent]: [], + [openEventGithubActions]: [claCheckGithubAction], + [reopenEventGithubActions]: [claCheckGithubAction], + [synchronizeEvent]: [mergeConflictCheck], + [closeEvent]: [allMergeConflictCheck], + [editEvent]: [], + [issuesLabelEvent]: [], + [issuesAssignedEvent]: [], + [pushEvent]: [], + [pullRequestReviewEvent]: [pullRequestReviewCheck], + [issueCommentCreatedEvent]: [respondToReviewCheck], + }, + }; + ``` + +4. Save the changes to **`constants.js`**. ## Running the bot locally