Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #336: provided a clear description of where to add the repo name in the constants.js file. #340

Merged
merged 4 commits into from
Dec 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 34 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a blank line above "3." and above "2.", similar to how you have a space between sections 3. and 4.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2024-12-10 185802

@seanlip will this work?

- 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
Expand Down
Loading