mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2026-09-29 00:32:06 +08:00
🐛 fix(github_utils): 修复路径解析问题 (#1668)
* 🐛 fix(github_utils): 修复路径解析问题 * chore(version): Update version to v0.2.3-a39d7a3 --------- Co-authored-by: AkashiCoin <AkashiCoin@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
import re
|
||||
|
||||
GITHUB_REPO_URL_PATTERN = re.compile(
|
||||
r"^https://github.com/(?P<owner>[^/]+)/(?P<repo>[^/]+)(/tree/(?P<branch>[^/]+))?$"
|
||||
)
|
||||
"""github仓库地址正则"""
|
||||
|
||||
JSD_PACKAGE_API_FORMAT = (
|
||||
"https://data.jsdelivr.com/v1/packages/gh/{owner}/{repo}@{branch}"
|
||||
)
|
||||
"""jsdelivr包地址格式"""
|
||||
|
||||
GIT_API_TREES_FORMAT = (
|
||||
"https://api.github.com/repos/{owner}/{repo}/git/trees/{branch}?recursive=1"
|
||||
)
|
||||
"""git api trees地址格式"""
|
||||
|
||||
CACHED_API_TTL = 300
|
||||
"""缓存api ttl"""
|
||||
|
||||
RAW_CONTENT_FORMAT = "https://raw.githubusercontent.com/{owner}/{repo}/{branch}/{path}"
|
||||
"""raw content格式"""
|
||||
|
||||
ARCHIVE_URL_FORMAT = "https://github.com/{owner}/{repo}/archive/refs/heads/{branch}.zip"
|
||||
"""archive url格式"""
|
||||
|
||||
RELEASE_ASSETS_FORMAT = (
|
||||
"https://github.com/{owner}/{repo}/releases/download/{version}/{filename}"
|
||||
)
|
||||
"""release assets格式"""
|
||||
|
||||
RELEASE_SOURCE_FORMAT = (
|
||||
"https://codeload.github.com/{owner}/{repo}/legacy.{compress}/refs/tags/{version}"
|
||||
)
|
||||
"""release 源码格式"""
|
||||
Reference in New Issue
Block a user