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

feat: add github action to self-assign the issue #2538

Merged
merged 1 commit into from
Oct 19, 2024
Merged
Show file tree
Hide file tree
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
40 changes: 40 additions & 0 deletions .github/workflows/auto-assign-issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# This workflow has been inspired by https://github.com/MrPowers/quinn/blob/main/.github/workflows/assign-on-comment.yml

name: Auto assign the issue via `take` comment

on:
issue_comment:
types: [created]

permissions:
issues: write

jobs:
auto-assign:
runs-on: ubuntu-latest
if: (!github.event.issue.pull_request) && github.event.comment.body == 'take'
concurrency:
# Only run one a time per user
group: ${{ github.actor }}-auto-assign-issue
steps:
- name: Check if issue can be assigned
id: check-assignee
run: |
# Check if the user is already assigned to the issue
RESPONSE=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -LI https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/assignees/${{ github.event.comment.user.login }} -o /dev/null -w '%{http_code}' -s)
echo "HTTP_CODE=$RESPONSE" >> $GITHUB_ENV
- name: Assign issue to commenter
if: env.HTTP_CODE == '204'
run: |
# Assign the issue to the user who commented 'take'
echo "Assigning issue #${{ github.event.issue.number }} to @${{ github.event.comment.user.login }}"
curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -d '{"assignees": ["${{ github.event.comment.user.login }}"]}' https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/assignees
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Log failure to assign
if: env.HTTP_CODE != '204'
run: |
# Log the failure to assign the issue
echo "Issue #${{ github.event.issue.number }} cannot be assigned to @${{ github.event.comment.user.login }}. HTTP response code: ${{ env.HTTP_CODE }}"
27 changes: 16 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Thank you for taking the time to contribute to our project. Please take a moment
To get started, look at the existing [**Issues**](https://github.com/rupali-codes/LinksHub/issues) or [**create a new issue**](https://github.com/rupali-codes/LinksHub/issues/new/choose)!

### Setup guidelines 🪜

Follow these steps to setup LinksHub on your local machine

1. [Fork](https://github.com/rupali-codes/LinksHub/fork) the project
Expand Down Expand Up @@ -73,14 +74,14 @@ Follow these steps to setup LinksHub on your local machine
> docker pull linkshub/app
> ```
>
> 3. Start the docker container with:
> 3. Start the docker container with:
>
> ```bash
> docker compose up
> ```
>
> 4. Now start adding your changes.
> **Note:** You don't need to restart the container again and again after starting it once, because the changes you make will reflect in the container instantly.
> **Note:** You don't need to restart the container again and again after starting it once, because the changes you make will reflect in the container instantly.
7. Make your changes before staging them.
Expand Down Expand Up @@ -110,7 +111,7 @@ Follow these steps to setup LinksHub on your local machine

### Appending new Categories 🔗

You can suggest new categories by going to of the current categories on [our website and click on the "Wanna Share Something?" button](https://github.com/rupali-codes/LinksHub/issues/new?assignees=&labels=chore%2Cgoal%3A+new-category%2Cpriority%3A+low&projects=&template=---category-suggestion.yml&title=%5BADD%5D+%3Cwrite+the+name+of+category%2Fsubcategory%3E).
You can suggest new categories by going to of the current categories on [our website and click on the "Wanna Share Something?" button](https://github.com/rupali-codes/LinksHub/issues/new?assignees=&labels=chore%2Cgoal%3A+new-category%2Cpriority%3A+low&projects=&template=---category-suggestion.yml&title=%5BADD%5D+%3Cwrite+the+name+of+category%2Fsubcategory%3E).

#### 🌟Follow these steps to add your Category/Subcategory to the Hub

Expand Down Expand Up @@ -145,11 +146,11 @@ Follow these steps to setup LinksHub on your local machine
```ts
//category
subcategory name:
subcategory name:
`description of subcategory`,
```
```
> [!NOTE]
> [!NOTE]
> It's essential to add a description when submitting a pull request to add a subcategory to merge it in the codebase.

---
Expand Down Expand Up @@ -200,7 +201,7 @@ When adding _YouTube_ channel links, please specify _the language_ of the channe
---

### Adding and Updating Category Description 📝
>

> ✨ You can also create [issue(s)](https://github.com/rupali-codes/LinksHub/issues/new/choose) to suggest new descriptions. The maintainers will review them and then assign them.

#### 🌟Follow these steps to add your links to the Hub
Expand Down Expand Up @@ -287,6 +288,10 @@ git commit -m "feat(auth): Implement user signup process (#789)"
---
## Auto-Assigning Issues
We have implemented a feature that allows users to comment "**take**" on an issue to be auto-assigned the issue without having to depend on or wait for the maintainers to assign the issue before working on it.
## Making Pull Requests 💥
1. When you submit a pull request, several tests are automatically run
Expand All @@ -312,8 +317,8 @@ git commit -m "feat(auth): Implement user signup process (#789)"
### Levels

We came up with this chart so you can gauge the issue's difficulty and pick ones that fit within your skillset:
| Points | Contribution |
| Points | Contribution |
|---------------------|-----------------------------------------------------------------------------|
| `priority: low`: | Addition of new links/categories or doing any small task (e.g fixing typos) |
| `priority: medium`: | Modifying an existing feature |
| `priority: high`: | Making completely new feature |
| `priority: low`: | Addition of new links/categories or doing any small task (e.g fixing typos) |
| `priority: medium`: | Modifying an existing feature |
| `priority: high`: | Making completely new feature |
Loading