trigger: detect default branch from repo instead of hardcoding master
Some checks failed
CI / Lint & Check (push) Failing after 26s
Some checks failed
CI / Lint & Check (push) Failing after 26s
This commit is contained in:
@@ -27,7 +27,10 @@ def cmd_trigger(api: GiteaAPI, args: argparse.Namespace) -> int:
|
||||
return 1
|
||||
|
||||
workflow = args.workflow
|
||||
ref = args.ref or "master"
|
||||
ref = args.ref
|
||||
if not ref:
|
||||
repo_info = api.get_repo(owner, repo)
|
||||
ref = (repo_info or {}).get("default_branch", "main")
|
||||
|
||||
# Parse inputs if provided
|
||||
inputs = {}
|
||||
|
||||
Reference in New Issue
Block a user