Skip to content

DaPulse/action-add-labels

This branch is up to date with actions-ecosystem/action-add-labels:main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

1a9c371 · May 1, 2023

History

47 Commits
Aug 4, 2021
May 10, 2020
May 1, 2023
May 2, 2020
Apr 30, 2023
May 2, 2020
May 2, 2020
May 2, 2020
May 3, 2020
May 2, 2020
Apr 30, 2023
Mar 4, 2021
May 2, 2020
May 1, 2023
May 2, 2020
May 1, 2023

Repository files navigation

Action Add Labels

actions-workflow-test release license

screenshot

This is a GitHub Action to add GitHub labels to an issue or a pull request.

This action extract the number from an issue or a pull request which has triggered this by default. It means you don't need to care about something annoying like whether you should use ${{ github.event.issue.number }} or ${{ github.event.pull_request.number }}.

It would be more useful to use this with other GitHub Actions' outputs.

Inputs

NAME DESCRIPTION TYPE REQUIRED DEFAULT
github_token A GitHub token. string false ${{ github.token }}
labels The labels' name to be added. Must be separated with line breaks if there're multiple labels. string true N/A
number The number of the issue or pull request. number false N/A
repo The owner and repository name. e.g.) Codertocat/Hello-World string false ${{ github.event.issue.number }} or ${{ github.event.pull_request.number }}

Example

Add a single label with a comment

name: Add Label

on:
  issues:
    types: opened

jobs:
  add_label:
    runs-on: ubuntu-latest
    steps:
      - name: checkout
        uses: actions/checkout@v2

      - name: add label
        uses: actions-ecosystem/action-add-labels@v1
        if: ${{ startsWith(github.event.comment.body, '/add-labels') }}
        with:
          labels: bug

Add multiple labels with a comment

name: Add Labels

on:
  pull_request:
    types: opened

jobs:
  add_labels:
    runs-on: ubuntu-latest
    steps:
      - name: checkout
        uses: actions/checkout@v2

      - name: add labels
        uses: actions-ecosystem/action-add-labels@v1
        if: ${{ startsWith(github.event.comment.body, '/add-labels') }}
        with:
          labels: |
            documentation
            changelog

License

Copyright 2020 The Actions Ecosystem Authors.

Action Add Labels is released under the Apache License 2.0.

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 79.4%
  • JavaScript 20.6%