ci: assign new issues and pull requests to the maintainer - #34
Merged
Conversation
Copied verbatim from libmuslim, where this has been running against both issues and pull requests. Same behaviour everywhere rather than a per-repository variant. Two properties worth keeping in mind when reading it. It uses pull_request_target so that PRs from forks get a write-capable token, which is only safe because the workflow never checks out or runs any code from the pull request, and it skips anything that already has an assignee so that reopening an item does not silently reassign it. No third-party action, only the gh CLI that ships on every runner.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the auto-assign workflow this repository was missing.
libmuslimandmuslimtifyalready have it; this brings the remaining three into line.Copied verbatim from libmuslim rather than rewritten, so all five repositories behave identically and there is one thing to maintain rather than five variants.
What it does
Assigns every newly opened or reopened issue and pull request to
rizukirr. GitHub has no repository setting for this, and it does not assign an author to their own issue or PR, so a workflow is the smallest thing that actually works.Two properties worth knowing
It uses
pull_request_targetrather thanpull_requestso that PRs opened from forks get a token with write permission. That trigger runs in the base repository context with secrets available, which is only safe because the workflow never checks out or executes any code from the pull request. The file carries a comment saying so, and a checkout step must never be added to it.It skips anything that already has an assignee, so reopening an item someone has already assigned does not silently reassign it.
No third-party action is used, only the
ghCLI that ships on every runner.