dragon-code/github-notifications 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

dragon-code/github-notifications

最新稳定版本:1.13.0

Composer 安装命令:

composer create-project dragon-code/github-notifications

包简介

Reduce your notification burden on GitHub!

README 文档

README

The Dragon Code: GitHub Notifications

Stable Version Total Downloads Github Workflow Status License

GitHub Notifications was created by, and is maintained by The Dragon Code, and is a simple command line tool to mark all notifications about issues or rejected PRs as read on a given organization.

Installation

PHP 8.2+ is required. To get the latest version, simply require the project using Composer:

composer global require dragon-code/github-notifications:*

Alternatively, you can simply clone the repo and run composer install in the folder.

Update global dependencies

To update global dependencies, use the console command:

composer global update

Authentication

You'll also need to create yourself a personal access token for GitHub's API with access to the notifications scope.

By default, we check several places for the presence of a token in the following order:

  1. The token parameter passed when calling the console command
  2. The GITHUB_TOKEN environment variable
  3. ~/.composer/auth.json file
  4. ~/.config/.composer/auth.json file
  5. ~/.config/composer/auth.json file
  6. ~/AppData/Roaming/Composer/auth.json file
  7. ~/composer/auth.json file
  8. %USERPROFILE%/AppData/Roaming/Composer/auth.json file

If the token is not found, you will receive a message about this.

Usage

To read all issue notifications:

notifications read

To clear all issue notifications for the Laravel organization:

notifications read laravel

Or, if you are specifying a token:

notifications read laravel --token {...}

In addition, you can use any part of the organization name and/or repository name to check against the template:

notifications read laravel/framework
# or
notifications read lara*/fra
# or
notifications read framework
# or
notifications read work
# or
notifications read fra*rk

Pattern matching is implemented using the Str::is method.

You can also specify several names:

notifications read laravel/framework laravel/jet

When determining the name, the str_starts_with function is used.

Options

By default, only those Issues and Pull Requests that have been closed or merged are marked as read.

But you can define the parameters yourself:

-r, --except-repository  Exclude repositories from processing
-i, --except-issues      Exclude issues from processing
-p, --except-pulls       Exclude Pull Requests from processing
-m, --except-mentions    Exclude notifications with your mention from processing
-o, --with-open          Process including open Issues and Pull Requests
-n, --no-interaction     Do not ask any interactive question
-q, --quiet              Do not output any message

For example:

# except issues + with open
notifications read laravel -ion

With this set of options, notifications that have:

  • whose repository name begins with the word laravel
  • Pull Requests only, both open and closed
  • will not be asked to continue in the console

You can call the console command to display help information:

notifications read --help

You can also exclude certain repositories:

notifications read laravel -ion -r laravel/framework -r laravel/breeze

With this set of options, notifications that have:

  • whose repository name begins with the word laravel
  • Pull Requests only, both open and closed
  • will not be asked to continue in the console
  • repositories laravel/framework and laravel/breeze will not be processed

Result

Before

Execute a console command with the following parameters:

notifications read -n --except-mentions

before

After

after

After with --with-open option

Execute a console command with the following parameters:

notifications read -n --except-mentions --with-open

after

Support Us

❤️ The Dragon Code? Please consider supporting our collective on Boosty.

License

This package is licensed under the MIT License.

统计信息

  • 总下载量: 831
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 6
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 6
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-03-28