From 051a5de12153ae18741ead581fc5c95081846156 Mon Sep 17 00:00:00 2001 From: Username Date: Sat, 14 Mar 2026 11:44:42 +0100 Subject: [PATCH] trigger: detect default branch from repo instead of hardcoding master --- src/gitea_ci/commands/workflows.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gitea_ci/commands/workflows.py b/src/gitea_ci/commands/workflows.py index 5656bbb..3e06748 100644 --- a/src/gitea_ci/commands/workflows.py +++ b/src/gitea_ci/commands/workflows.py @@ -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 = {}