7 Star 24 Fork 10

Gitee 极速下载/questdb

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/questdb/questdb
克隆/下载
github_run_action.py 1.65 KB
一键复制 编辑 原始数据 按行查看 历史
#!/usr/bin/env python3
import sys
sys.dont_write_bytecode = True
import subprocess
import json
import argparse
VALID_ACTIONS = [
"rebuild_rust",
"rebuild_native_libs",
"rebuild_rust_test"
]
def check_gh_authentication():
"""Check if GitHub CLI is authenticated."""
result = subprocess.run(
["gh", "auth", "status"],
capture_output=True, text=True
)
if result.returncode != 0:
print("GitHub CLI is not authenticated. Please run `gh auth login` to authenticate.")
sys.exit(1)
def get_current_branch():
"""Get the current git branch."""
result = subprocess.run(
["git", "rev-parse", "--abbrev-ref", "HEAD"],
capture_output=True, text=True, check=True
)
return result.stdout.strip()
def trigger_github_action(branch, action):
"""Trigger GitHub Action on the specified branch and get the run ID."""
result = subprocess.run(
["gh", "workflow", "run", f"{action}.yml", "--ref", branch],
capture_output=True, text=True
)
if result.returncode != 0:
print(f"Could not trigger GitHub Action for branch: {branch}")
print(result.stderr)
sys.exit(1)
print(f"To view the status, run: `gh run list` and `gh run view <run-id>`")
def parse_args():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("actions", metavar="ACTION", choices=VALID_ACTIONS, nargs="*")
return parser.parse_args()
def main():
args = parse_args()
branch = get_current_branch()
check_gh_authentication()
for action in args.actions:
trigger_github_action(branch, action)
if __name__ == "__main__":
main()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/mirrors/questdb.git
git@gitee.com:mirrors/questdb.git
mirrors
questdb
questdb
master

搜索帮助