@azu/github-label-setup

中文文档
5.2.0发布于 2026/10/18MITTypeScriptES Module构建来源已验证近 30 天下载 2198

GitHub label setup script.

原始使用文档
文档目录11 节
  1. Install
  2. Usage
  3. Npm packages for labels
  4. Default Labels
  5. Integration with GitHub Releases
  6. Related
  7. Changelog
  8. Running tests
  9. Contributing
  10. Author
  11. License

@azu/github-label-setup

Opinionated GitHub label setup tool.

demo

  • Create starter GitHub labels
  • Migrate existing labels
  • No configuration - It is opinionated

Install

Install with npm:

npm install --global @azu/github-label-setup

Usage

This tool works without any configuration.

Usage
  $ github-label-setup --token xxx

Options

  -h, --help                  [Boolean] output usage information
  -l, --labels <path>         [Path:String] the path to look for the label configuration in. Default: labels.json
  --token <token>             [String] a GitHub access token (also settable with a GITHUB_TOKEN or GITHUB_ACCESS_TOKEN environment variable)
  -d, --dry-run               [Boolean] calculate the required label changes but do not apply them
  -A, --allow-added-labels    [Boolean] allow additional labels in the repo, and don't delete them
  
GitHub Release Options
  
  --addReleaseYml             [Boolean] add a .github/release.yml file
  --addReleaseYmlOutputPath   [Path:String] the path to write the .github/release.yml file to. Default: .github/release.yml

Examples
    # Overwrite labels in the current repository
    $ github-label-setup --token "$GITHUB_TOKEN"
    # Add labels to the current repository
    $ github-label-setup --token "$GITHUB_TOKEN" --allow-added-labels
    # Add .github/release.yml to integrate with GitHub Releases
    $ github-label-setup --addReleaseYml

You will need to get a GitHub Personal Accesses token to update labels of your repository. You need to generate GitHub Personal Accesses token with "repo" scope.

This tool is a wrapper of github-label-sync.

Npm packages for labels

labels can be set requireable path like npm packages.

$ github-label-setup --token xxx --labels @owner/github-label-presets

See Label JSON format.

Default Labels

These are opinionated labels.

demo

  • #ededed duplicate - This issue or Pull Request already exists
  • #e99695 help wanted - Extra attention is needed
  • #7057ff good first issue - Good for newcomers
  • #ee0701 Priority: Critical
  • #d93f0b Priority: High
  • #fbca04 Priority: Medium
  • #0e8a16 Priority: Low
  • #000000 Status: Abandoned - The issue or Pull Request is wontfix
  • #ee0701 Status: Blocked - Progress on the issue is Blocked
  • #cccccc Status: In Progress - Work in Progress
  • #d4c5f9 Status: Proposal - Request for comments
  • #2E7733 Status: PR Welcome - Welcome to Pull Request
  • #fbca04 Status: Review Needed - Request for review comments
  • #F9C90A Status: Need More Info - Lacks enough info to make progress
  • #b60205 Type: Breaking Change - Includes breaking changes
  • #ee0701 Type: Bug - Bug or Bug fixes
  • #0e8a16 Type: Documentation - Documentation only changes
  • #1d76db Type: Feature - New Feature
  • #fbca04 Type: Refactoring - A code change that neither fixes a bug nor adds a feature
  • #257759 Type: Testing - Adding missing tests or correcting existing tests
  • #abd406 Type: Maintenance - Repository Maintenance
  • #ffd412 Type: CI - Changes to CI configuration files and scripts
  • #cc317c Type: Question - Further information is requested
  • #ee0701 Type: Security - Vulnerability disclosure or Fixing security issue
  • #de52a8 Type: Accessibility - Barrier affecting people with disabilities
  • #0366d6 Type: Dependencies - Dependency issues or Changes to dependency files
  • #0366d6 Type: Meta - Related to repository itself (This will not be includes in Release Note)
  • #0366d6 Type: Release - Related to release process (This will not be includes in Release Note)

Integration with GitHub Releases

GitHub Releases support automatically generate release notes using labels. --addReleaseYml option will add .github/release.yml file to your repository.

# Add .github/release.yml to integrate with GitHub Releases
$ github-label-setup --addReleaseYml

For more details, see GitHub Releases document.

Changelog

See Releases page.

Running tests

Install devDependencies and Run npm test:

npm i -d && npm test

Contributing

Pull requests and stars are always welcome.

For bugs and feature requests, please create an issue.

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

Author

License

MIT © azu

版本与发布记录

@azu/github-label-setup 共发布 23 个版本,首次发布于 2017/05/16;过去 12 个月发布了 2 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
5.2.0latest2026/10/1821 天前
5.1.22026/10/1821 天前
5.1.12025/09/061.2 年前
5.1.02023/01/093 年前
5.0.12023/01/083 年前
5.0.02023/01/083 年前

关于 @azu/github-label-setup 的常见问题

@azu/github-label-setup 是什么?

GitHub label setup script.

如何安装 @azu/github-label-setup?

在项目目录运行 npm install @azu/github-label-setup,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 github-label-setup,可以用 npx github-label-setup 直接运行。

@azu/github-label-setup 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@azu/github-label-setup 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@azu/github-label-setup 可以商用吗?

@azu/github-label-setup 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@azu/github-label-setup 的下载量有多少?

根据 npm 官方下载统计,@azu/github-label-setup 在 2026/10/08 – 2026/11/06 这 30 天内被下载 2,198 次,日均约 73 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@azu/github-label-setup 还在维护吗?

最新版本 5.2.0 发布于 2026/10/18(21 天前);至今共发布 23 个版本,其中过去 12 个月发布了 2 个;首次发布于 2017/05/16。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。