Github - Auto assign Issue to Project
Asked Answered
S

6

19

I would like to Auto Assign an issue to a project in Github. Basically automate the below screenshot for every issue automatically opened. Any ideas?

enter image description here

Sodamide answered 23/6, 2020 at 8:0 Comment(0)
T
7

You can use create-or-update-project-card to achieve this.

on:
  issues:
    types: [opened]
jobs:
  createCard:
    runs-on: ubuntu-latest
    steps:
      - name: Create or Update Project Card
        uses: peter-evans/create-or-update-project-card@v1
        with:
          project-name: My project
          column-name: My column
Tufthunter answered 23/6, 2020 at 23:39 Comment(0)
M
20

There are two natively supported options:

Mudslinger answered 22/4, 2022 at 4:13 Comment(2)
This should really be the accepted answer now - tried both options above without any luck and wish I saw this sooner! Also, I found that it only requires the repo, and project scopes, not write:org or read:org.Neurilemma
@AlexKoshy Oh, right, that has changed for v0.1.0, updated yesterday! I'll update, thanks for pointing it out.Mudslinger
T
7

You can use create-or-update-project-card to achieve this.

on:
  issues:
    types: [opened]
jobs:
  createCard:
    runs-on: ubuntu-latest
    steps:
      - name: Create or Update Project Card
        uses: peter-evans/create-or-update-project-card@v1
        with:
          project-name: My project
          column-name: My column
Tufthunter answered 23/6, 2020 at 23:39 Comment(0)
T
2

There is an app Project Bot to automate this because right now it seems like it is not possible to do so with just the GitHub project configuration.

Here is the Project Bot description from it's repo

This bot will automatically add new Issues or Pull Requests to a Project board based on specially formatted Cards in each Column of a Project. It also allows you to customize the rules for moving Issues between Columns.

Here is the project-bot repo: https://github.com/philschatz/project-bot

I hope it helps!

Tuttle answered 23/6, 2020 at 8:12 Comment(0)
S
1

I managed to make it work using this workflow.

Sodamide answered 23/6, 2020 at 9:18 Comment(0)
L
1

You can configure your project's built-in workflows to automatically add items from repositories that match a filter. https://docs.github.com/en/issues/planning-and-tracking-with-projects/automating-your-project/adding-items-automatically

enter image description here

Limnology answered 22/3 at 17:18 Comment(0)
V
0

Check out the Sept. 2021 post "New code review assignment settings and team filtering improvements"

It refers to "Managing code review assignment for your team", which includes:

Routing algorithms

Code review assignments automatically choose and assign reviewers based on one of two possible algorithms.

  • The round robin algorithm chooses reviewers based on who's received the least recent review request, focusing on alternating between all members of the team regardless of the number of outstanding reviews they currently have.

  • The load balance algorithm chooses reviewers based on each member's total number of recent review requests and considers the number of outstanding reviews for each member.
    The load balance algorithm tries to ensure that each team member reviews an equal number of pull requests in any 30 day period.

And now:

New settings give teams more control over the behavior:

  • Limit assignment to only direct members of the team. Previously, team review requests could be assigned to direct members of the team or members of child teams.

  • Continue with automatic assignment even if one or more members of the team are already requested. Previously, a team member who was already requested would be counted as one of the team's automatic review requests.

  • Keep a team assigned to review even if one or more members is newly assigned. Previously, the team review request was always replaced by one or more individual review requests. This would make it difficult to find pull requests where a specific team was requested.

Code review assignments settings can be managed under Team settings > Code review assignment:

https://static.mcmap.net/file/mcmap/ZG-AbGLDKwfpLi21bC2jaRA/user-images.githubusercontent.com/2503052/134927199-77fbb389-bd6a-46c4-8313-9616683694f6.png?ssl=1

Vimen answered 29/9, 2021 at 21:44 Comment(2)
This is only about assigning to people, yes? Not to Projects?Mook
@Mook True. For team members (within a project) assignment.Vimen

© 2022 - 2024 — McMap. All rights reserved.