enhance: replace ${BRANCH} with current branch name if the custom action's scope is Repository (#2274)

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo
2026-04-17 17:23:04 +08:00
parent 7b875d6005
commit 8395efdd55

View File

@@ -219,7 +219,7 @@ namespace SourceGit.ViewModels
Models.Tag t => org.Replace("${TAG}", t.Name),
Models.Remote r => org.Replace("${REMOTE}", r.Name),
Models.CustomActionTargetFile f => org.Replace("${FILE}", f.File).Replace("${SHA}", f.Revision?.SHA ?? string.Empty),
_ => org
_ => org.Replace("${BRANCH}", _repo.CurrentBranch?.Name ?? "HEAD")
};
}