はじめに
This tutorial demonstrates how to use the andymckay/labeler action in a workflow to label newly opened or reopened issues. For example, you can add the triage label every time an issue is opened or reopened. Then, you can see all issues that need to be triaged by filtering for issues with the triage label.
In the tutorial, you will first make a workflow file that uses the andymckay/labeler action. Then, you will customize the workflow to suit your needs.
ワークフローの作成
-
このプロジェクト管理ワークフローを適用したいリポジトリを選択してください。 書き込みアクセス権を持つ既存のリポジトリを利用することも、新しいリポジトリを作成することもできます。 リポジトリの作成に関する詳細は「新しいリポジトリの作成」を参照してください。
-
リポジトリに、
.github/workflows/YOUR_WORKFLOW.ymlというファイルをYOUR_WORKFLOWの部分を選択した名前で置き換えて作成してください。 これがワークフローファイルです。 GitHub上での新しいファイルの作成に関する詳しい情報については「新しいファイルの作成」を参照してください。 -
Copy the following YAML contents into your workflow file.
YAML name: Label issues on: issues: types: - reopened - opened jobs: label_issues: runs-on: ubuntu-latest steps: - name: Label issues uses: andymckay/labeler@1.0.2 with: add-labels: "triage" -
Customize the parameters in your workflow file:
- Change the value for
add-labelsto the list of labels that you want to add to the issue. Separate multiple labels with commas. For example,"help wanted, good first issue". For more information about labels, see "Managing labels."
- Change the value for
-
ワークフローファイルを、リポジトリのデフォルトブランチにコミットしてください。 詳細は「新しいファイルを作成する」を参照してください。
Testing the workflow
Every time an issue in your repository is opened or reopened, this workflow will add the labels that you specified to the issue.
Test out your workflow by creating an issue in your repository.
- Create an issue in your repository. For more information, see "Creating an issue."
- To see the workflow run that was triggered by creating the issue, view the history of your workflow runs. 詳しい情報については、「ワークフロー実行の履歴を表示する」を参照してください。
- When the workflow completes, the issue that you created should have the specified labels added.
次のステップ
- To learn more about additional things you can do with the
andymckay/labeleraction, like removing labels or skipping this action if the issue is assigned or has a specific label, see theandymckay/labeleraction documentation. - To learn more about different events that can trigger your workflow, see "Events that trigger workflows." The
andymckay/labeleraction only works onissues,pull_request, orproject_cardevents. - Search GitHub for examples of workflows using this action.