Skip to main content

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

Project description

logo

nonebot-plugin-git-poller

LICENSE pypi python uv codecov

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

安装

使用 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.6.tar.gz (21.3 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.6-py3-none-any.whl (27.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nonebot_plugin_git_poller-0.1.6.tar.gz
  • Upload date:
  • Size: 21.3 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.6.tar.gz
Algorithm Hash digest
SHA256 83026b486be586bb7c8d772c136520cf4a7e0ec4991bc5d7b1e9a40006c714eb
MD5 7cce537424593c1af0d2c44283b4f255
BLAKE2b-256 1fc9b6edd6a31b146c013359047f6863d24fa84cc00e91d226bb5d3b545e1fde

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nonebot_plugin_git_poller-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 27.2 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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 fa17cb2bc44c7878af86064ca0cbe0ba303f288dd99227286e886bd2e30deefb
MD5 17f3e0bcd8eb5a88f114433d06930b7b
BLAKE2b-256 20fb3b8afd59dc02491d182c1907e9dd32378e5f200171bb7994e2090d605159

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