Skip to content
user-minus

GitHub Action

Unassign contributor after days of inactivity

v1.0.2 Latest version

Unassign contributor after days of inactivity

user-minus

Unassign contributor after days of inactivity

This action will unassign any issue after days of inactivity. Best used together with actions/stale

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Unassign contributor after days of inactivity

uses: BoundfoxStudios/[email protected]

Learn more about this action in BoundfoxStudios/action-unassign-contributor-after-days-of-inactivity

Choose a version

Action: Unassign contributor after days of inactivity

This action will unassign a contributor from an issue after days of inactivity.

This action is best used with actions/stale.

See a running example here.

Usage

Inputs

All inputs are optional

Input Description Default
token PAT for GitHub API authentication ${{ github.token }}
last-activity Specifies after how many days the issue should get unassigned 7
labels Only search issues having the specified comma-separated labels Stale
exempt-assignees Exempt specified assignees from being unassigned
labels-to-remove Labels to remove after unassignement Stale
message Comment message to create after unassignedment Due to longer inactivity, this issue has been unassigned automatically.

Outputs

Output Description
unassigned-issues-count Count of issues unassigned in this run
unassigned-issues JSON-Array with unassigned issue numbers (e.g. [1, 3, 44])

Example

name: Example

on:
  schedule:
    - cron: '12 22 * * *' # Runs at 22:12 UTC every day

jobs:
  # Best used in combination with actions/stale to assign a Stale label
  
  unassign-issues-labeled-waiting-for-contributor-after-7-days-of-inactivity:
    name: Unassign issues labeled "Wartet auf Contributor" after 7 days of inactivity.
    runs-on: ubuntu-latest
    steps:
      - uses: boundfoxstudios/action-unassign-contributor-after-days-of-inactivity@main
        with:
          last-activity: 7 # After how many days the issue should get unassigned
          labels: 'Stale' # Only search for issues containing this labels (comma-separated)
          exempt-assignees: 'Octo,Cat' # Exempt some assignees from being unassigned
          labels-to-remove: 'Stale' # Labels to remove after unassigning an issue
          message: 'Automatically unassigned after 7 days of inactivity.'

Caveats

On larger repos it could be that the action will fail due to reaching API limits. If that happens for posting the comment message, it will simply be ignored right now.