DEV Community

Cover image for Assign pull request author automatically with GitHub Actions
Toshimaru
Toshimaru

Posted on • Updated on

Assign pull request author automatically with GitHub Actions

My Workflow

Who should be the assignee of Pull Request ❓

In most cases, the Pull Request author should be assigned as an assignee.

My workflow, named Auto Author Assign, assigns PR author automatically when PR is opened.

toshimaru/auto-author-assign

Submission Category:

Maintainer Must-Haves

Auto Author Assign makes it easy for OSS maintainer to assign someone to PR and filter PR from the list.

Assigned Users

Yaml File or Link to Code

.github/workflows/auto-author-assign.yml:

name: 'Auto Author Assign'

on:
  pull_request_target:
    types: [opened, reopened]

jobs:
  assign-author:
    runs-on: ubuntu-latest
    steps:
      - uses: toshimaru/auto-author-assign@v1.1.0
        with:
          repo-token: "${{ secrets.GITHUB_TOKEN }}"

Source code:

GitHub logo toshimaru / auto-author-assign

GitHub Actions: Assign pull request author automatically.

Build

auto-author-assign

GitHub Actions: Assign pull request author automatically.

OG image

Why this action?

In most cases, pull request author should be assigned an assignee of the pull request.

This action automatically assigns PR author as an assignee.

Usage

# .github/workflows/auto-author-assign.yml
name: 'Auto Author Assign'

on:
  pull_request_target:
    types: [opened, reopened]

jobs:
  assign-author:
    runs-on: ubuntu-latest
    steps:
      - uses: toshimaru/auto-author-assign@v1.1.0
        with:
          repo-token: "${{ secrets.GITHUB_TOKEN }}"

Skip assigning author

auto-author-assign action skips assigning the author when:

  • Someone is already assigned as an assignee
  • The author is a bot

Additional Resources / Info

Discussion (0)