@@ -119,35 +119,11 @@ public List<ICustomActionControlParameter> ControlParameters
119
119
get ;
120
120
} = [ ] ;
121
121
122
- public ExecuteCustomAction ( Repository repo , Models . CustomAction action )
122
+ public ExecuteCustomAction ( Repository repo , Models . CustomAction action , object scopeTarget )
123
123
{
124
124
_repo = repo ;
125
125
CustomAction = action ;
126
- Target = new Models . Null ( ) ;
127
- PrepareControlParameters ( ) ;
128
- }
129
-
130
- public ExecuteCustomAction ( Repository repo , Models . CustomAction action , Models . Branch branch )
131
- {
132
- _repo = repo ;
133
- CustomAction = action ;
134
- Target = branch ;
135
- PrepareControlParameters ( ) ;
136
- }
137
-
138
- public ExecuteCustomAction ( Repository repo , Models . CustomAction action , Models . Commit commit )
139
- {
140
- _repo = repo ;
141
- CustomAction = action ;
142
- Target = commit ;
143
- PrepareControlParameters ( ) ;
144
- }
145
-
146
- public ExecuteCustomAction ( Repository repo , Models . CustomAction action , Models . Tag tag )
147
- {
148
- _repo = repo ;
149
- CustomAction = action ;
150
- Target = tag ;
126
+ Target = scopeTarget ?? new Models . Null ( ) ;
151
127
PrepareControlParameters ( ) ;
152
128
}
153
129
@@ -206,9 +182,10 @@ private string PrepareStringByTarget(string org)
206
182
207
183
return Target switch
208
184
{
209
- Models . Branch b => org . Replace ( "${BRANCH}" , b . FriendlyName ) ,
185
+ Models . Branch b => org . Replace ( "${BRANCH}" , b . FriendlyName ) . Replace ( "${REMOTE}" , b . Remote ) ,
210
186
Models . Commit c => org . Replace ( "${SHA}" , c . SHA ) ,
211
187
Models . Tag t => org . Replace ( "${TAG}" , t . Name ) ,
188
+ Models . Remote r => org . Replace ( "${REMOTE}" , r . Name ) ,
212
189
_ => org
213
190
} ;
214
191
}
0 commit comments