trigger: detect default branch from repo instead of hardcoding master
CI / Lint & Check (push) Failing after 26s
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
|
return 1
|
||||||
|
|
||||||
workflow = args.workflow
|
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
|
# Parse inputs if provided
|
||||||
inputs = {}
|
inputs = {}
|
||||||
|
|||||||
Reference in New Issue
Block a user