Github - 自动将问题分配给项目

Github - Auto assign Issue to Project

我想将问题自动分配给 Github 中的项目。基本上为自动打开的每个问题自动化下面的屏幕截图。有什么想法吗?

有一个应用 Project Bot to automate this because right now it seems like it is not possible 只需 GitHub 项目配置即可完成此操作。

这是来自 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.

这是项目机器人回购协议:https://github.com/philschatz/project-bot

希望对您有所帮助!

我设法使用 this 工作流程使其工作。

您可以使用 create-or-update-project-card 来实现。

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

查看 2021 年 9 月 post“New code review assignment settings and team filtering improvements

指的是“Managing code review assignment for your team”,其中包括:

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.

现在:

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:

对于新的 beta 项目,现在有一个官方行动来添加问题和拉取请求:actions/add-to-project。它“处于测试阶段,但是 API 是稳定的”。

使用动作大致类似

      - uses: actions/add-to-project@main
        with:
          project-url: https://github.com/orgs/<orgName>/projects/<projectNumber>
          github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}
          labeled: bug, needs-triage
          label-operator: OR

令牌需要 repowrite:orgread:org 范围。