8000 repo sync by Octomerger · Pull Request #22427 · github/docs · GitHub
[go: up one dir, main page]

Skip to content

repo sync #22427

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Dec 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Adding labels to issues
title: Issue にラベルを追加する
shortTitle: Add labels to issues
intro: 'You can use {% data variables.product.prodname_actions %} to automatically label issues.'
intro: '{% data variables.product.prodname_actions %} を使用して、Issue に自動的にラベルを付けることができます。'
redirect_from:
- /actions/guides/adding-labels-to-issues
versions:
Expand All @@ -13,24 +13,28 @@ type: tutorial
topics:
- Workflows
- Project management
ms.openlocfilehash: a3523069b9422ecd8107007ca5e00fb0071dd738
ms.sourcegitcommit: 4d6d3735d32540cb6de3b95ea9a75b8b247c580d
ms.translationtype: HT
ms.contentlocale: ja-JP
ms.lasthandoff: 11/30/2022
ms.locfileid: '148185562'
---
{% data reusables.actions.enterprise-beta %} {% data reusables.actions.enterprise-github-hosted-runners %}

{% data reusables.actions.enterprise-beta %}
{% data reusables.actions.enterprise-github-hosted-runners %}
## はじめに

## Introduction
このチュートリアルでは、ワークフローで [`actions/github-script` アクション](https://github.com/marketplace/actions/github-script)を使用して、新しくオープンまたは再オープンした Issue にラベルを付ける方法を示します。 たとえば、Issue をオープンまたは再オープンするたびに `triage` ラベルを追加できます。 次に、`triage` ラベルで Issue をフィルター処理して、トリアージする必要のあるすべての Issue を確認できます。

This tutorial demonstrates how to use the [`actions/github-script` action](https://github.com/marketplace/actions/github-script) 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.
`actions/github-script` アクションを使うと、ワークフローで {% data variables.product.prodname_dotcom %} API を簡単に使用できます。

The `actions/github-script` action allows you to easily use the {% data variables.product.prodname_dotcom %} API in a workflow.
チュートリアルでは、[`actions/github-script` アクション](https://github.com/marketplace/actions/github-script)を使用するワークフロー ファイルをまず作成します。 次に、ニーズに合わせてワークフローをカスタマイズします。

In the tutorial, you will first make a workflow file that uses the [`actions/github-script` action](https://github.com/marketplace/actions/github-script). Then, you will customize the workflow to suit your needs.

## Creating the workflow
## ワークフローの作成

1. {% data reusables.actions.choose-repo %}
2. {% data reusables.actions.make-workflow-file %}
3. Copy the following YAML contents into your workflow file.
3. 次の YAML コンテンツをワークフローファイルにコピーします。

```yaml{:copy}
name: Label issues
Expand All @@ -56,23 +60,23 @@ In the tutorial, you will first make a workflow file that uses the [`actions/git
})
```

4. Customize the `script` parameter in your workflow file:
- The `issue_number`, `owner`, and `repo` values are automatically set using the `context` object. You do not need to change these.
- Change the value for `labels` to 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](/github/managing-your-work-on-github/managing-labels#applying-labels-to-issues-and-pull-requests)."
4. ワークフロー ファイルの `script` パラメーターをカスタマイズします。
- `issue_number``owner``repo` の値は、`context` オブジェクトを使って自動的に設定されます。 これらを変更する必要はありません。
- `labels` の値を、Issue に追加するラベルのリストに変更します。 複数のラベルはコンマで区切ります。 たとえば、「 `["help wanted", "good first issue"]` 」のように入力します。 ラベルの詳細については、「[ラベルを管理する](/github/managing-your-work-on-github/managing-labels#applying-labels-to-issues-and-pull-requests)」を参照してください。
5. {% data reusables.actions.commit-workflow %}

## 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.
リポジトリ内の Issue をオープンするか再オープンするたびに、このワークフローは指定したラベルを Issue に追加します。

Test out your workflow by creating an issue in your repository.
リポジトリに Issue を作成して、ワークフローをテストします。

1. Create an issue in your repository. For more information, see "[Creating an issue](/github/managing-your-work-on-github/creating-an-issue)."
2. To see the workflow run that was triggered by creating the issue, view the history of your workflow runs. For more information, see "[Viewing workflow run history](/actions/managing-workflow-runs/viewing-workflow-run-history)."
3. When the workflow completes, the issue that you created should have the specified labels added.
1. リポジトリで Issue を作成します。 詳細については、「[Issue の作成](/github/managing-your-work-on-github/creating-an-issue)」を参照してください。
2. Issue の作成によってトリガーされたワークフローの実行を確認するには、ワークフローの実行履歴を表示します。 詳細については、「[ワークフロー実行の履歴を表示する](/actions/managing-workflow-runs/viewing-workflow-run-history)」を参照してください。
3. ワークフローが完了すると、作成した Issue に指定されたラベルが追加されます。

## Next steps
## 次の手順

- To learn more about additional things you can do with the `actions/github-script` action, see the [`actions/github-script` action documentation](https://github.com/marketplace/actions/github-script).
- To learn more about different events that can trigger your workflow, see "[Events that trigger workflows](/actions/reference/events-that-trigger-workflows#issues)."
- [Search GitHub](https://github.com/search?q=%22uses:+actions/github-script%22&type=code) for examples of workflows using this action.
- `actions/github-script` アクションで実行できる追加の機能について詳しくは、[`actions/github-script` アクションのドキュメント](https://github.com/marketplace/actions/github-script)にアクセスしてください。
- ワークフローをトリガーできるさまざまなイベントの詳細については、「[ワークフローをトリガーするイベント](/actions/reference/events-that-trigger-workflows#issues)」を参照してください。
- このアクションを使用するワークフローの例については [GitHub を検索](https://github.com/search?q=%22uses:+actions/github-script%22&type=code)してください。
Loading
0