注意
- Projects(全新的项目体验)现已推出。 有关 Projects 的详细信息,请参阅“关于 Projects”。
- 只能为组织、存储库或已经至少有一个项目(经典)的用户创建新的项目(经典)。 如果无法创建项目(经典),则改为创建项目。
注意
GitHub Enterprise Server 目前不支持 GitHub 托管的运行器。 可以在 GitHub public roadmap 上查看有关未来支持计划的更多信息。
Introduction
This tutorial demonstrates how to use the alex-page/github-project-automation-plus
action to automatically move an issue to a specific column on a 项目(经典) when the issue is assigned. For example, when an issue is assigned, you can move it into the In Progress
column your 项目(经典).
In the tutorial, you will first make a workflow file that uses the alex-page/github-project-automation-plus
action. Then, you will customize the workflow to suit your needs.
Creating the workflow
-
选择要应用此项目管理工作流程的仓库。 您可以使用您有写入权限的现有仓库,或者创建一个新的仓库。 有关创建仓库的详细信息,请参阅 创建新仓库。
-
In your repository, choose a 项目(经典). You can use an existing project, or you can create a new project. For more information about creating a project, see 创建 project (classic).
-
在存储库中,创建一个名为
.github/workflows/YOUR_WORKFLOW.yml
的文件,将YOUR_WORKFLOW
替换为你选择的名称。 这是一个工作流程文件。 有关在 GitHub 上创建新文件的详细信息,请参阅 创建新文件。 -
Copy the following YAML contents into your workflow file.
YAML # 此工作流使用未经 GitHub 认证的操作。 # 它们由第三方提供,并受 # 单独的服务条款、隐私政策和支持 # 文档。 # GitHub 建议将操作固定到提交 SHA。 # 若要获取较新版本,需要更新 SHA。 # 还可以引用标记或分支,但该操作可能会更改而不发出警告。 name: Move assigned card on: issues: types: - assigned jobs: move-assigned-card: runs-on: ubuntu-latest steps: - uses: alex-page/github-project-automation-plus@7ffb872c64bd809d23563a130a0a97d01dfa8f43 with: project: Docs Work column: In Progress repo-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
# 此工作流使用未经 GitHub 认证的操作。 # 它们由第三方提供,并受 # 单独的服务条款、隐私政策和支持 # 文档。 # GitHub 建议将操作固定到提交 SHA。 # 若要获取较新版本,需要更新 SHA。 # 还可以引用标记或分支,但该操作可能会更改而不发出警告。 name: Move assigned card on: issues: types: - assigned jobs: move-assigned-card: runs-on: ubuntu-latest steps: - uses: alex-page/github-project-automation-plus@7ffb872c64bd809d23563a130a0a97d01dfa8f43 with: project: Docs Work column: In Progress repo-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
-
Customize the parameters in your workflow file:
- Change the value for
project
to the name of your 项目(经典). If you have multiple 项目(经典) with the same name, thealex-page/github-project-automation-plus
action will act on all projects with the specified name. - Change the value for
column
to the name of the column where you want issues to move when they are assigned. - Change the value for
repo-token
:- Create a personal access token (classic) with the
repo
scope. For more information, see 管理个人访问令牌. - Store this personal access token as a secret in your repository. For more information about storing secrets, see Using secrets in GitHub Actions.
- In your workflow file, replace
PERSONAL_ACCESS_TOKEN
with the name of your secret.
- Create a personal access token (classic) with the
- Change the value for
-
将工作流程文件提交到仓库的默认分支。 有关详细信息,请参阅“创建新文件”。
Testing the workflow
Whenever an issue in your repository is assigned, the issue will be moved to the specified 项目(经典) column. If the issue is not already on the 项目(经典), it will be added to the 项目(经典).
If your repository is user-owned, the alex-page/github-project-automation-plus
action will act on all projects in your repository or personal account that have the specified project name and column. Likewise, if your repository is organization-owned, the action will act on all projects in your repository or organization that have the specified project name and column.
Test your workflow by assigning an issue in your repository.
- Open an issue in your repository. For more information, see 创建议题.
- Assign the issue. For more information, see 分配议题和拉取请求到其他 GitHub 用户.
- To see the workflow run that assigning the issue triggered, view the history of your workflow runs. For more information, see Viewing workflow run history.
- When the workflow completes, the issue that you assigned should be added to the specified 项目(经典) column.
Next steps
- To learn more about additional things you can do with the
alex-page/github-project-automation-plus
action, like deleting or archiving project cards, visit thealex-page/github-project-automation-plus
action documentation.