百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
P

pull-request-labeler-action

> 开发工具
开源

:zap: GitHub 操作可自动为您的拉取请求添加标签(使用已提交的文件) :sparkles:

99 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

:zap: GitHub 操作可自动为您的拉取请求添加标签(使用已提交的文件) :sparkles:

THIS ACTION IS DEPRECATED AND ARCHIVED.

You should not use it anymore, A better alternative is https://github.com/actions/labeler

DEPRECATED, do not use anymore

Readme kept as archive


This repository provides a GitHub action to automatically label a pull request based on committed files.

Table of Contents

  • Common usage
  • Breaking change
  • Startup
    • Configuration
    • Use GitHub action
      • Settings for v1.0.0+ release (deprecated)
      • Settings for v2.0.0+ release
  • Contributing
    • Commands
  • License

Common usage

When pushing, the action will be triggered and will look for committed files over your branch. It applies configured labels whenever it find a file whose name matches the associated regular expression.

Breaking change

Starting from August 2019, GitHub switch Actions syntax from HCL to YAML. The previous syntax will no longer be supported by GitHub on September 30, 2019.

As a consequence, please use v2.0.0+ release and note that all v1.x.x are deprecated and will no longer work on September 30, 2019.

Startup

Configuration

Create a file into your root project directory: .github/label-pr.yml:

yaml
- regExp: ".*\\.ts+$"
  labels: ["typescript"]
- regExp: ".*\\.sql+$"
  labels: ["database", "critical"]
- regExp: ".*\\.md+$"
  labels: ["documentation"]
- regExp: "^(pom\\.xml|package\\.json|build\\.gradle)$"
  labels: ["dependencies"]
- regExp: ".*\\.(zip|jar|war|ear)+$"
  labels: ["artifact", "invalid"]

This is a sample to illustrate how you can customize your settings by configuring your own regex and labels

The configuration is made of a list of Filter which are composed of:

  • regExp: a regular expression which will be tested over the filenames
  • labels: a list of labels to apply if the filenames match

If the labels do not exist yet in your repository configuration, they will be created anyway.

Use GitHub action

Settings for v1.0.0+ release (deprecated)

Create a file into your root project directory (if it does not exist yet): .github/main.workflow:

workflow "New workflow" {
  resolves = ["PR label by Files"]
  on = "pull_request"
}

action "PR label by Files" {
  uses = "decathlon/[email protected]"
  secrets = ["GITHUB_TOKEN"]
}

Settings for v2.0.0+ release

Create a file into your root project directory: .github/workflows/labeler.yml:

…

Please note that you can move the label-pr.yml to another location, if so, then do not forget to update the above CONFIG_PATH variable.

Contributing

  • The project is built using Typescript # 3.5.2
  • We use a tslint as a linter for defining code style which configuration may change
  • We use Jest as the testing framework

To start, you just need to clone the repository and open it in your favorite IDE. You may need to set it up so it uses the node configuration (package.json) and tslint configuration (tslint.json).

Commands

  • To run unit tests: npm run test:watch
  • To build: npm run build:main

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

TypeScriptgithub-actionslabelsproject-managementprojects

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类开发工具
定价开源

> 相关工具

V
VS Code
流行的开源代码编辑器
G
Git
分布式版本控制系统
V
Vite
下一代前端构建工具