Skip to content

Latest commit

 

History

History
68 lines (50 loc) · 8.97 KB

README.md

File metadata and controls

68 lines (50 loc) · 8.97 KB

💬 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

📸 Screenshots

assign_1 assign_2

🚀 Usage

Create a workflow (eg: .github/workflows/assign.yml learn more about Creating a Workflow file) to utilize the trigger action with content:

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/assign-issue-action@v2.1.1
        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! 🎉<br>⚠ Note that this issue will become unassigned if it isn't closed within **{{ totalDays }} days**.<br><br>🔧 A maintainer can also add the **{{ inputs.pin_label }}** label to prevent it from being unassigned automatically.<br>
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 }}.<br>⚠️ It will become unassigned if it isn't closed within **{{ daysUntilUnassign }} days**. <br><br>🔧 A maintainer can also add you to the list of assignees or swap you with the current assignee.<br>

✏️ Contributing

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

⚖️ Licence

The scripts and documentation in this project are released under the MIT License