Skip to content

Commit

Permalink
feat: generalized the app to be installed by anyone
Browse files Browse the repository at this point in the history
  • Loading branch information
Varun-Kolanu committed Jun 8, 2024
1 parent 95cacf1 commit 4d5bb69
Show file tree
Hide file tree
Showing 14 changed files with 397 additions and 197 deletions.
12 changes: 0 additions & 12 deletions .dockerignore

This file was deleted.

8 changes: 0 additions & 8 deletions Dockerfile

This file was deleted.

113 changes: 92 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,104 @@
# csoc-bot
# GitHub Issue Assigner Bot

> A GitHub App built with [Probot](https://github.com/probot/probot) that A bot for managing workflow of CSOC projects
This GitHub bot helps manage issue assignments in a repository by automatically assigning or unassigning issues based on predefined rules and user commands in comments. The bot is implemented using Probot, a framework for building GitHub Apps.

## Setup
# Features

- Automatic Assignment: Users can request assignment to an issue by commenting with a specific command.
- Limit Assignees: Configure maximum number of assignees allowed per issue.
- Limit Assigned Issues: Set a limit on the number of issues a user can be assigned to at a time in the repository.
- Automatic unassignment: Users can request unassignment to an issue by commenting with a specific command.
- Issue opened comments: Bot greets the user when issue is opened
- Customizable Responses: Customize the bot's responses and prompts using a YAML configuration file.

# Usage

1. [Install](https://github.com/apps/issue-assigner) the bot in your account.
2. After installing the bot, create a file `.github/issue-assigner.yml` in the repo and paste the following content:

```yml
# Remove or comment the line from yml if you don't need that feature

# The name of bot you would like to be mentioned by users. {name} will be replaced by the below name
name: "issue-assigner"

######################## Issue assignment ########################

# Prompt entered by user to request assign the issue to him/her
assign-prompt: "@{name} claim" # For example, @issue-assigner claim

# Comment from bot if the issue got already assigned to the user requesting
issue-already-assigned: "You have already been assigned to this issue."

# Maximum number of assignees for an issue
max-assignees: 1

# Maximum number of assignees reached for the requested issue
max-assignees-reached: "Sorry, maximum limit for assignees in this issue has reached. Please check other issues or contact a maintainer."

# Maximum number of open issues a user can have assigned at a time in the repo
max-issues-for-user: 1

# If all OK, the comment from bot to tell that issue got assigned
assigned-comment: "This issue has been successfully assigned to you! 🚀"

```sh
# Install dependencies
npm install
######################## Issue un-assignment ########################

# Prompt entered by user to request un-assignment of the issue to him/her
unassign-prompt: "@{name} abandon"

# If the issue was already not assigned to the user
issue-was-not-assigned: "You were not assigned to this issue."

# If criteria is matched, the issue will get un-assigned
unassigned-comment: "You have been unassigned to this issue successfully."

######################## Issue Opened ########################

# If the user who opened issue is NOT a maintainer of the repo
issue-opener-not-maintainer: "Thank you for opening this issue. Maintainers will check and approve if seems to be useful."

# If the user who opened issue IS a maintainer of the repo
issue-opener-is-maintainer: "Comment '@{name} claim' to get this issue assigned or '@{name} abandon' to get this issue unassigned."
```
3. You can remove a line from yml if you don't need that feature.
4. You can edit the values in the yml to customize the comments from the bot.
# Contributing
If you have any suggestions or want to report a bug, open an issue or make a pull request.
## Prerequisites
1. Git installed
2. Node installed
## Setup
# Run the bot
npm start
```
1. Clone the repository
## Docker
```bash
git clone https://github.com/Varun-Kolanu/issue-assigner.git
```

```sh
# 1. Build container
docker build -t csoc-bot .
2. Open the repo

# 2. Start container
docker run -e APP_ID=<app-id> -e PRIVATE_KEY=<pem-value> csoc-bot
```
```bash
cd issue-assigner
```

## Contributing
3. Install dependencies

If you have suggestions for how csoc-bot could be improved, or want to report a bug, open an issue! We'd love all and any contributions.
```bash
npm i
```

For more, check out the [Contributing Guide](CONTRIBUTING.md).
4. Run the app
```bash
npm start
```

## License
# License

[ISC](LICENSE) © 2024 Varun Kolanu
[ISC](https://github.com/Varun-Kolanu/issue-assigner/blob/main/LICENSE) © 2024 Varun Kolanu
6 changes: 3 additions & 3 deletions app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ default_permissions:

# Repository contents, commits, branches, downloads, releases, and merges.
# https://developer.github.com/v3/apps/permissions/#permission-on-contents
# contents: read
contents: read

# Deployments and deployment statuses.
# https://developer.github.com/v3/apps/permissions/#permission-on-deployments
Expand Down Expand Up @@ -124,12 +124,12 @@ default_permissions:
# https://developer.github.com/v3/apps/permissions/
# organization_administration: read
# The name of the GitHub App. Defaults to the name specified in package.json
name: CSOC Bot
name: Issue Assigner
# The homepage of your GitHub App.
# url: https://example.com/

# A description of the GitHub App.
description: Bot for CSOC
description: A bot for managing issue assignments
# Set to true when your GitHub App is available to the public or false when it is only accessible to the owner of the app.
# Default: true
# public: false
45 changes: 45 additions & 0 deletions docs/privacy-policy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Privacy Policy for Issue Assigner GitHub App

## Introduction

Thank you for using the Issue Assigner GitHub App. This Privacy Policy describes how the App collects, uses, and protects your personal information when you use the App.

## Data Collection

The App collects the following data:

- GitHub usernames of collaborators and issue openers, commentors
- Issue content and comments

## Data Usage

The collected data is used to:

- Automate issue assignments
- Manage issue comments
- Data Sharing

We do not share your data with third parties, except:

- With GitHub as necessary to operate the App
- To comply with legal obligations

## Data Security

We implement security measures to protect your data, but please note that no method of transmission over the internet or electronic storage is 100% secure.

## User Rights

You have the right to:

- Access your data
- Modify your data
- Delete your data

## Changes to this Privacy Policy

We may update this Privacy Policy from time to time. We will notify you of any changes by posting the new Privacy Policy on this page.

## Contact Us

If you have any questions about this Privacy Policy, please contact us at this [email](mailto:[email protected]).
146 changes: 0 additions & 146 deletions index.js

This file was deleted.

14 changes: 8 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
{
"name": "csoc-bot",
"name": "issue-assigner",
"version": "1.0.0",
"private": true,
"description": "A bot for managing workflow of CSOC projects",
"description": "A bot for managing issue assignments",
"author": "Varun Kolanu",
"license": "ISC",
"homepage": "https://github.com//",
"homepage": "https://github.com/Varun-Kolanu/issue-assigner",
"keywords": [
"probot",
"github",
"probot-app"
"probot-app",
"issue",
"issue-assigner"
],
"scripts": {
"start": "node ./main.js",
"dev": "nodemon ./main.js",
"start": "node ./src/server.js",
"dev": "nodemon ./src/server.js",
"test": "node --test"
},
"dependencies": {
Expand Down
Loading

0 comments on commit 4d5bb69

Please sign in to comment.