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
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.
Choose a repository where you want to apply this project management workflow. You can use an existing repository that you have write access to, or you can create a new repository. For more information about creating a repository, see "Creating a new repository."
In your repository, create a file called
YOUR_WORKFLOWwith a name of your choice. This is a workflow file. For more information about creating new files on GitHub, see "Creating new files."
Copy the following YAML contents into your workflow file.
name: Label issues on: issues: types: - reopened - opened jobs: label_issues: runs-on: ubuntu-latest steps: - name: Label issues uses: email@example.com 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
Commit your workflow file to the default branch of your repository. For more information, see "Creating new files."
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. For more information, see "Viewing workflow run history."
- 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 the
- To learn more about different events that can trigger your workflow, see "Events that trigger workflows." The
andymckay/labeleraction only works on
- Search GitHub for examples of workflows using this action.