项目作者: actions-ecosystem

项目描述 :
🏷️ GitHub Action to add labels
高级语言: TypeScript
项目地址: git://github.com/actions-ecosystem/action-add-labels.git
创建时间: 2020-05-02T22:26:54Z
项目社区:https://github.com/actions-ecosystem/action-add-labels

开源协议:Apache License 2.0

下载


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

  1. name: Add Label
  2. on:
  3. issues:
  4. types: opened
  5. jobs:
  6. add_label:
  7. runs-on: ubuntu-latest
  8. steps:
  9. - name: checkout
  10. uses: actions/checkout@v2
  11. - name: add label
  12. uses: actions-ecosystem/action-add-labels@v1
  13. if: ${{ startsWith(github.event.comment.body, '/add-labels') }}
  14. with:
  15. labels: bug

Add multiple labels with a comment

  1. name: Add Labels
  2. on:
  3. pull_request:
  4. types: opened
  5. jobs:
  6. add_labels:
  7. runs-on: ubuntu-latest
  8. steps:
  9. - name: checkout
  10. uses: actions/checkout@v2
  11. - name: add labels
  12. uses: actions-ecosystem/action-add-labels@v1
  13. if: ${{ startsWith(github.event.comment.body, '/add-labels') }}
  14. with:
  15. labels: |
  16. documentation
  17. changelog

License

Copyright 2020 The Actions Ecosystem Authors.

Action Add Labels is released under the Apache License 2.0.