Skip to main content

按群订阅 Git 仓库更新的 NoneBot2 插件,支持多仓库、多分支定时拉取

Project description

logo

nonebot-plugin-git-poller

LICENSE pypi python uv codecov

按群订阅 Git 仓库更新的 NoneBot2 插件,支持多仓库、多分支定时拉取,自动推送 commit 更新摘要并上传源码压缩包。

支持 GitHub、GitLab、Gitee 以及自建 Git 服务等主流 Git 托管平台,兼容标准 HTTP/HTTPS Git 远端。

安装

使用 nb-cli 安装
nb plugin install nonebot-plugin-git-poller
使用包管理器安装

在 NoneBot 项目目录中,根据你使用的包管理器,输入相应的安装命令:

uv
uv add nonebot-plugin-git-poller
pdm
pdm add nonebot-plugin-git-poller
poetry
poetry add nonebot-plugin-git-poller

打开 NoneBot 项目根目录下的 pyproject.toml 文件,在 [tool.nonebot] 部分追加写入:

[tool.nonebot]
plugins = ["nonebot_plugin_git_poller"]

配置

配置项 必填 默认值 说明
git_poller_default_schedule 每日04:00 新关注仓库的默认定时规则;留空关闭默认定时注册。
git_poller_timezone Asia/Shanghai 定时任务时区。
git_poller_proxy HTTP/HTTPS Git 拉取代理。
git_poller_timeout 60.0 HTTP/HTTPS Git 拉取超时,单位秒。
git_poller_archive_password 全局默认压缩包密码;为空时默认不设置密码。
git_poller_file_base_url 条件 上传压缩包时使用的 NoneBot HTTP 服务根地址;Bot 和 OneBot/NapCat 不在同一个文件系统时必须配置,例如 http://nonebot:8088。

指令

/关注仓库 仓库url [--分支名]
/取关仓库 仓库url [--分支名]
/设置仓库 仓库url [--分支名]
/拉取仓库 仓库url [--分支名]
/仓库摘要 仓库url [--分支名]
/仓库列表

带 URL 的命令都支持可选分支后缀,例如 /关注仓库 https://example.test/repo.git --dev/关注仓库 不写分支时追踪远端默认分支;其他命令不写分支时优先使用本群本仓库的唯一订阅,若同仓库关注了多个分支则需要写 --分支名

/关注仓库 在当前群关注仓库。同一个群可以关注同一仓库的不同分支。

/取关仓库 移除当前群的对应仓库分支订阅,不影响其他群。

/设置仓库 进入设置流程。Bot 会回复:

输入设置数字选项
1. 修改当前仓库推送抓取时间
2. 修改当前仓库上传压缩包密码(选择后输入无则清除当前仓库密码回到全局默认)

回复 1 后,下一条消息必须是合法定时格式。回复 2 后,下一条消息会保存为当前仓库压缩包密码,此时输入 会清除当前仓库密码并回到全局默认。输入非法会取消。

/仓库列表 显示当前群关注的仓库、分支、定时、启用状态、last_success_sha 和压缩包密码来源。

/拉取仓库 立即拉取当前群已关注的仓库,上传最新的源码压缩包。

/仓库摘要 仅拉取远端并展示本群记录与远端 HEAD 的差异。

定时格式

支持:

每日hh:mm
每x天hh:mm
周xhh:mm

每x天x 使用 1 到 30 的整数;周x 只支持汉字 一二三四五六日/天

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nonebot_plugin_git_poller-0.1.7.tar.gz (21.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nonebot_plugin_git_poller-0.1.7-py3-none-any.whl (27.3 kB view details)

Uploaded Python 3

File details

Details for the file nonebot_plugin_git_poller-0.1.7.tar.gz.

File metadata

  • Download URL: nonebot_plugin_git_poller-0.1.7.tar.gz
  • Upload date:
  • Size: 21.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for nonebot_plugin_git_poller-0.1.7.tar.gz
Algorithm Hash digest
SHA256 90ab6ab851608cc8a1388662311ae2668acf77a0d1d611185fbb867f27f9c54c
MD5 7cb356dc87da40ddffb79de5694a2cd1
BLAKE2b-256 72e732a8096185b00c1c56b4963aee0295f971df854185ba11e13cce99879e45

See more details on using hashes here.

File details

Details for the file nonebot_plugin_git_poller-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: nonebot_plugin_git_poller-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 27.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for nonebot_plugin_git_poller-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 37fd0ceb7b89f56750b683d8b951ccf8dd3f4b32d873966033c2d5753e1c37f1
MD5 f60ad54c897ec2cb74fbb2e1fd981238
BLAKE2b-256 b65bb7e14860fe5b9e5923a4e3c2e03fd0ed40868acef1485af346811523ef8e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page