Github回购监视客户端。
watching的Python项目详细描述
>github-repos-repos-repos-repos-repos-repos-watching框架
`` shell
/>pip-install-watching
` ` `
/>
简单用法
ctx函数`ctx.upsert_file_和u pr是更新或创建文件以及创建请求请求请求的助手。
``python
watcher=watcher=watcher=watcher=watcher
er({
“github访问令牌”:访问令牌,
}
def license_中间件(ctx:context):
branch='watcher_license_create'
path='/license'
new_content='mit\n\ncreated by joway'
message='add mit license'
pr title='init:mit license'
pr body='-create mit license'
file_branch='master'
ctx.upsert_file_和_pr(
path=path,content=new_content,branch=branch,
should_upsert=lambda new,old:new!=old,message=message,
pr戋title=pr戋title,pr戋body=pr戋body,
)
def filter戋func(repo:repo):
如果repo.name='repo watching demo':
返回true
它将由每个repo
观察者执行。其他中间件)
过滤你所需要的回购协议
repos=watcher.get所有回购协议(filter=filter=filter=func)
``` python
获取提交列表
ctx.repo.commit\u list()
#访问您的github用户名org name
ctx.repo.repo.login
ctx.repo.repo.repo.repo.repo.repo.file
;创建文件
ctx.repo.repo.file.repo.repo.file更新文件
获取文件
ctx.repo.file.repo.file_get()
;创建分支
ctx.repo.repo.repo.branch.repo.branch.repo.branch
ctx.repo.pr_create()
```