actions-ecosystem/action-remove-labels
GitHub: actions-ecosystem/action-remove-labels
一款 GitHub Action 插件,用于在 CI/CD 工作流中自动移除 Issue 或 Pull Request 上的 GitHub 标签。
Stars: 60 | Forks: 35
# Action 移除 Labels
[][actions-workflow-test]
[][release]
[][license]

这是一个用于移除 issue 或 pull request 上 GitHub 标签的 GitHub Action。
此 action 默认会从触发它的 issue 或 pull request 中提取编号。
这意味着你不需要去烦恼诸如应该使用 `${{ github.event.issue.number }}` 还是 `${{ github.event.pull_request.number }}` 这样的问题。
将它与其他 GitHub Actions 的输出结合使用会更加实用。
## 输入参数
| 名称 | 描述 | 类型 | 必填 | 默认值 |
| --------------- | ---------------------------------------------------------------------------------------- | -------- | -------- | ------------------------------------------------------------------------------- |
| `github_token` | 一个 GitHub token。 | `string` | `false` | `${{ github.token }}` |
| `labels` | 要移除的标签名称。如果有多个标签,必须用换行符分隔。 | `string` | `true` | `N/A` |
| `number` | issue 或 pull request 的编号。 | `number` | `false` | `${{ github.event.issue.number }}` 或 `${{ github.event.pull_request.number }}` |
| `repo` | 所有者和仓库名称。例如:`Codertocat/Hello-World` | `string` | `false` | `N/A` |
| `fail_on_error` | 发生错误时 action 是否失败。[true,false] | `bool` | `false` | `false` |
## 示例
### 移除单个标签并附带评论
```
name: Remove Label
on: [issue_comment]
jobs:
remove_label:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-ecosystem/action-remove-labels@v1
if: ${{ startsWith(github.event.comment.body, '/remove-labels') }}
with:
labels: bug
```
### 移除多个标签并附带评论
```
name: Remove Labels
on: [issue_comment]
jobs:
remove_labels:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-ecosystem/action-remove-labels@v1
if: ${{ startsWith(github.event.comment.body, '/remove-labels') }}
with:
labels: |
documentation
changelog
```
## 许可证
版权所有 2020 The Actions Ecosystem Authors.
Action Remove Labels 基于 [Apache License 2.0](./LICENSE) 发布。
标签:GitHub Actions, Linux 内核安全, MITM代理, 开源框架, 持续集成, 标签管理, 网络调试, 自动化, 自动化攻击, 自动笔记, 项目管理