Skip to content

feat(workflow): add workflow to unassign inactive issue assignees#341

Open
Harxhit wants to merge 6 commits into
Dev-Card:mainfrom
Harxhit:unassign-workflow
Open

feat(workflow): add workflow to unassign inactive issue assignees#341
Harxhit wants to merge 6 commits into
Dev-Card:mainfrom
Harxhit:unassign-workflow

Conversation

@Harxhit
Copy link
Copy Markdown
Collaborator

@Harxhit Harxhit commented May 26, 2026

Auto-unassign issues without linked PRs

Summary

Adds a scheduled GitHub Actions workflow that automatically checks assigned open issues and unassigns them if no linked pull request is found.

The workflow runs every 5 days and can also be triggered manually using workflow_dispatch. If an assigned issue does not have a linked open PR, the workflow:

  • Removes all assignees
  • Posts an automated notification comment
  • Informs contributors how to retain assignment by opening and linking a PR

This helps keep issue assignments active, prevents stale ownership, and improves repository maintenance.


Type of Change

  • Bug fix
  • New feature
  • Refactor (no functional change)
  • UI / Design change
  • Tests only
  • Documentation
  • Infrastructure / DevOps
  • Security

What Changed

  • Added a new GitHub Actions workflow to detect assigned issues without linked PRs
  • Configured the workflow to run automatically every 5 days via cron schedule
  • Added workflow_dispatch support for manual execution
  • Implemented timeline event checks to detect linked open pull requests
  • Automatically removes assignees from issues that do not have linked PRs
  • Added automated notification comments explaining the unassignment
  • Included workflow permissions for issue write access
  • Added support for repository authentication using GITHUB_TOKEN

Workflow Configuration

This workflow requires the GitHub token to authenticate API requests:

github-token: ${{ secrets.GITHUB_TOKEN }}

The token is used for:

  • Reading issue timeline events
  • Checking linked pull requests
  • Removing assignees
  • Posting automated comments

How to Test

  1. Assign a user to an open issue
  2. Leave the issue without any linked pull request
  3. Trigger the workflow manually using workflow_dispatch or wait for the scheduled run
  4. Verify that:
    • The assignee is removed
    • An automated notification comment is posted
  5. Create a linked PR for another issue and verify that the assignment remains unchanged

Checklist

  • My code follows the project's coding style (pnpm -r run lint passes).
  • TypeScript compiles without errors (pnpm -r run typecheck).
  • I have added or updated tests for the changes I made.
  • All tests pass locally (pnpm -r run test).
  • I have updated documentation where necessary.
  • No new console.log or debug statements left in the code.
  • Breaking changes are documented in this PR description.

Additional Context

The workflow relies on GitHub issue timeline events to identify cross-referenced pull requests. Issues with linked open PRs are preserved, while stale assignments without linked work are automatically cleaned up.

@Harxhit Harxhit requested a review from ShantKhatri May 26, 2026 07:42
@Harxhit Harxhit added devops gssoc:approved Required label for every approved PR. Gives the base +50 points and enables contribution tracking. labels May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devops gssoc:approved Required label for every approved PR. Gives the base +50 points and enables contribution tracking.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant