Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/takanome-dev/assign-issue-action

🤖 A github action that assign issues based on "/assign" command (or any trigger you want to use)
https://github.com/takanome-dev/assign-issue-action

actions gh-actions github github-actions slash-commands typescript

Last synced: 3 months ago
JSON representation

🤖 A github action that assign issues based on "/assign" command (or any trigger you want to use)

Awesome Lists containing this project

README

        

💬 Assign Issue Action ✋

Licence Badge Release Badge GitHub Actions status GitHub Actions status

---

A GitHub Action that listens for a `/assign` "command" (or any trigger you want) and assigns the issue to the user who commented (or the user who triggered the action).
It can also unassign issues that have been assigned for a configured amount of time.

This Action is heavily inspired by [JasonEtco/slash-assign-action](https://github.com/JasonEtco/slash-assign-action)

## 📸 Screenshots

| ![assign_1](https://user-images.githubusercontent.com/79809121/207156221-9ef2da18-018e-46be-846b-f80bd1b60402.png) | ![assign_2](https://user-images.githubusercontent.com/79809121/207156278-8c338712-9519-4987-83d0-22c6bd63b7f5.png) |
| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ |

## 🚀 Usage

Create a workflow (eg: `.github/workflows/assign.yml` learn more about [Creating a Workflow file](https://docs.github.com/en/actions/using-workflows#creating-a-workflow-file)) to utilize the `trigger` action with content:

```yaml
name: Assign Issue

on:
schedule:
- cron: 0 0 * * *
issue_comment:
types: [created]
workflow_dispatch:

jobs:
assign:
runs-on: ubuntu-latest
steps:
- name: Assign the user or unassign stale assignments
uses: takanome-dev/[email protected]
with:
github_token: '${{ secrets.GITHUB_TOKEN }}'
# trigger: '/assign-me' # you can change the default trigger to something else
# required_label: # if present, the issue must have this label to be assigned
# assigned_label: 📍 Assigned
# days_until_unassign: 7
# learn more about the inputs below ⬇
```

## Inputs

Various inputs are defined in action.yml to let you configure the action:

| Name | Description | Default |
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `github_token` | PAT for GitHub API authentication. It's automatically generated when the action is running, so no need to add it into your secrets. | `${{ github.token }}` |
| `trigger` | The comment that triggers the action. This can be anything you want. | `/assign-me` |
| `assigned_label` | A label that is added to issues when they're assigned, to track which issues were assigned by this action. | `📍 Assigned` |
| `required_label` | If set, the issue must have this label to be assigned. | N/A |
| `days_until_unassign` | The span of time between a user assigning themselves to the issue being unassigned automatically by the action. | `7` |
| `📌 pin_label` | A label that prevents the user from being unassigned, typically for issues that are expected to take a long time. | `Pinned` |
| `assigned_comment` | The comment posted after a user has assigned themselves to an issue.
The following variables are supported:
- `inputs`: the inputs given to the action
- `comment`: an object holding the commenter infos
- `totalDays`: `days_until_unassign` | `👋 Hey @{{ comment.user.login }}, thanks for your interest in this issue! 🎉
⚠ Note that this issue will become unassigned if it isn't closed within **{{ totalDays }} days**.

🔧 A maintainer can also add the **{{ inputs.pin_label }}** label to prevent it from being unassigned automatically.
` |
| `already_assigned_comment` | The comment posted when a user tries to assign themselves to an issue that is already assigned. | `👋 Hey @{{ comment.user.login }}, this issue is already assigned to @{{ assignee.login }}.
⚠️ It will become unassigned if it isn't closed within **{{ daysUntilUnassign }} days**.

🔧 A maintainer can also add you to the list of assignees or swap you with the current assignee.
` |

## ✏️ Contributing

We would love you to contribute to this project, pull requests are welcome!
Please see the [CONTRIBUTING.md](CONTRIBUTING.md) for more information.

## ⚖️ Licence

The scripts and documentation in this project are released under the [MIT License](LICENSE)