Skip to content

Commit 8395efd

Browse files
committed
enhance: replace ${BRANCH} with current branch name if the custom action's scope is Repository (#2274)
Signed-off-by: leo <longshuang@msn.cn>
1 parent 7b875d6 commit 8395efd

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/ViewModels/ExecuteCustomAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ private string PrepareStringByTarget(string org)
219219
Models.Tag t => org.Replace("${TAG}", t.Name),
220220
Models.Remote r => org.Replace("${REMOTE}", r.Name),
221221
Models.CustomActionTargetFile f => org.Replace("${FILE}", f.File).Replace("${SHA}", f.Revision?.SHA ?? string.Empty),
222-
_ => org
222+
_ => org.Replace("${BRANCH}", _repo.CurrentBranch?.Name ?? "HEAD")
223223
};
224224
}
225225

0 commit comments

Comments
 (0)