Skip to content

repo sync #22428

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 3 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: Ajout d’étiquettes à des problèmes
shortTitle: Add labels to issues
intro: 'You can use {% data variables.product.prodname_actions %} to automatically label issues.'
intro: 'Vous pouvez utiliser {% data variables.product.prodname_actions %} pour étiqueter automatiquement les problèmes.'
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: fr-FR
ms.lasthandoff: 11/30/2022
ms.locfileid: '148185560'
---

{% 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

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.
Ce tutoriel montre comment utiliser [l’action `actions/github-script`](https://github.com/marketplace/actions/github-script) dans un workflow pour étiqueter les problèmes nouvellement ouverts ou rouverts. Par exemple, vous pouvez ajouter l’étiquette `triage` chaque fois qu’un problème est ouvert ou rouvert. Ensuite, vous pouvez voir tous les problèmes qui doivent être triés en filtrant les problèmes à l’aide de l’étiquette `triage`.

The `actions/github-script` action allows you to easily use the {% data variables.product.prodname_dotcom %} API in a workflow.
L’action `actions/github-script` vous permet d’utiliser facilement l’API {% data variables.product.prodname_dotcom %} dans un workflow.

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.
Dans le tutoriel, vous allez d’abord créer un fichier de workflow qui utilise [l’action `actions/github-script`](https://github.com/marketplace/actions/github-script). Ensuite, vous personnaliserez le workflow en fonction de vos besoins.

## Creating the workflow
## Création du 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. Copiez le contenu YAML suivant dans votre fichier de workflow.

```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. Personnalisez le paramètre `script` dans votre fichier de workflow :
- Les valeurs `issue_number`, `owner` et `repo` sont automatiquement définies à l’aide de l’objet `context` . Il est inutile de les modifier.
- Remplacez la valeur de `labels` par la liste des étiquettes que vous souhaitez ajouter au problème. Séparez plusieurs étiquettes par des virgules. Par exemple : `["help wanted", "good first issue"]`. Pour plus d’informations sur les étiquettes, consultez « [Gestion des étiquettes](/github/managing-your-work-on-github/managing-labels#applying-labels-to-issues-and-pull-requests) ».
5. {% data reusables.actions.commit-workflow %}

## Testing the workflow
## Test du workflow

Every time an issue in your repository is opened or reopened, this workflow will add the labels that you specified to the issue.
Chaque fois qu’un problème dans votre dépôt est ouvert ou rouvert, ce workflow ajoute les étiquettes que vous avez spécifiées au problème.

Test out your workflow by creating an issue in your repository.
Testez votre workflow en créant un problème dans votre dépôt.

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. Créez un problème dans votre dépôt. Pour plus d’informations, consultez « [Création d’un problème](/github/managing-your-work-on-github/creating-an-issue) ».
2. Pour voir l’exécution du workflow qui a été déclenchée par la création du problème, affichez l’historique des exécutions de votre workflow. Pour plus d’informations, consultez « [Affichage de l’historique des exécutions de workflows](/actions/managing-workflow-runs/viewing-workflow-run-history) ».
3. Une fois le workflow terminé, les étiquettes spécifiées doivent avoir été ajoutées au problème que vous avez créé.

## Next steps
## Étapes suivantes

- 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.
- Pour en savoir plus sur d’autres choses que vous pouvez faire avec l’action `actions/github-script`, consultez la [`actions/github-script`documentation sur l’action](https://github.com/marketplace/actions/github-script).
- Pour en savoir plus sur les différents événements qui peuvent déclencher votre workflow, consultez « [Événements qui déclenchent des workflows](/actions/reference/events-that-trigger-workflows#issues) ».
- [Visitez GitHub](https://github.com/search?q=%22uses:+actions/github-script%22&type=code) pour trouver des exemples de workflow utilisant cette action.
Loading