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 = {}