Skip to content

WORKFLOWS: Add workflow to unassign inactive contributors #6

Description

@LightCreator1007

Task

Add a scheduled GitHub Action that warns contributors who've gone inactive on
an assigned issue, then unassigns them if they stay inactive, freeing up stale
issues for others.

The bot warns first, then unassigns 2 days later if the contributor is still inactive.

"Inactive" means the issue has been assigned for 5+ days and shows no sign of
life from the assignee. Specifically, ALL of the following are true:

  • the assignee hasn't commented on the issue in the last 5 days, AND
  • there's no linked PR, OR a linked PR exists but has been silent (no push or
    reply from the author since a review was left or requested).

Scope

In scope:

  • A new workflow file (e.g. .github/workflows/stale-assignee.yml) on a schedule (daily cron).
  • Detect issues with the contribution in progress label that meet the inactivity definition above.
  • Warn: post a comment giving the contributor a heads-up and grace period.
  • Unassign: if still inactive 2 days after the warning, remove the assignee,
    remove the contribution in progress label, and comment explaining why plus
    inviting them to re-request via /assign.

Out of scope:

  • Changing the existing issue-manager.yml assignment logic.
  • Touching PRs directly (we only read PR state).

Workflow specifications

  • Trigger: schedule (e.g. cron: '0 0 * * *', once a day). Add workflow_dispatch for manual testing.
  • Permissions: issues: write, pull-requests: read.
  • State without a database: the warning comment doubles as the state marker.
    Include a hidden tag in it, e.g. <!-- stale-assignee-warning -->, so later runs can find it.
  • Logic per assigned, labelled issue:
    1. Skip if assigned < 5 days ago. (Use the assigned timeline event for the timestamp, not created_at.)
    2. Determine activity: check for a recent comment from the assignee, AND check
      for a linked PR and its last activity. Either signal counts as active.
    3. If active and a warning comment exists from a previous run, delete it so the state resets cleanly. Then do nothing further.
    4. If inactive and no warning comment exists yet, post the warning comment with the hidden tag.
    5. If inactive and a warning comment exists and it's 2+ days old, unassign, remove the label, and post the unassign comment.
  • Finding linked PRs: likely there's no direct REST endpoint for issue-to-PR links.
    Use the GraphQL API (available in github-script via github.graphql), or
    read the issue's timeline endpoint and look for cross-referenced events.
  • Suggested implementation: actions/github-script@v7 (matches the style already used in this repo).

Notes:

  • Be conservative. A wrong unassign is annoying, so when in doubt, treat as active.
  • A comment from the assignee counts as activity, even if no PR exists yet. Someone
    asking for help is engaged, not stale.
  • When activity resumes after a warning, delete the warning comment. This resets the
    state so the contributor gets a fresh warning cycle next time instead of being
    unassigned immediately.
  • The grace periods (5 days to warn, 2 more to unassign) and cron schedule should be
    easy to find and change at the top of the script.
  • "Assigned date" comes from the issue's timeline events (assigned action), since
    created_at is the issue's age, not the assignment's.
  • Test with workflow_dispatch and a throwaway issue before relying on the cron.
  • Linking a PR to an issue reliably needs Fixes #N / Part of #N in the PR body,
    which the repo's PR template already encourages, so lean on that.

Metadata

Metadata

Assignees

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions