Skip to content

Commit a31a7ab

Browse files
committed
adjust
1 parent 0662766 commit a31a7ab

1 file changed

Lines changed: 24 additions & 21 deletions

File tree

runnerconfiguration/compat/actions_runner_compat.go

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,18 @@ type DotnetRsaParameters struct {
2525
}
2626

2727
type DotnetAgent struct {
28-
AgentID string `json:"AgentId"`
29-
AgentName string `json:"AgentName"`
30-
DisableUpdate string `json:"DisableUpdate"`
31-
Ephemeral string `json:"Ephemeral"`
32-
PoolID string `json:"PoolId"`
33-
PoolName string `json:"PoolName,omitempty"`
34-
ServerURL string `json:"ServerUrl"`
35-
WorkFolder string `json:"WorkFolder"`
36-
GitHubURL string `json:"GitHubUrl"`
37-
UseV2Flow bool `json:"UseV2Flow"`
38-
ServerURLV2 string `json:"ServerUrlV2"`
28+
AgentID string `json:"AgentId"`
29+
AgentName string `json:"AgentName"`
30+
DisableUpdate string `json:"DisableUpdate"`
31+
Ephemeral string `json:"Ephemeral"`
32+
PoolID string `json:"PoolId"`
33+
PoolName string `json:"PoolName,omitempty"`
34+
ServerURL string `json:"ServerUrl"`
35+
WorkFolder string `json:"WorkFolder"`
36+
GitHubURL string `json:"GitHubUrl"`
37+
UseV2Flow bool `json:"UseV2Flow"`
38+
ServerURLV2 string `json:"ServerUrlV2"`
39+
UseRunnerAdminFlow bool `json:"UseRunnerAdminFlow,omitempty"`
3940
}
4041

4142
type DotnetCredentials struct {
@@ -157,6 +158,7 @@ func ToRunnerInstance(fileAccess ConfigFileAccess) (*runnerconfiguration.RunnerI
157158
PoolID: poolID,
158159
Auth: &protocol.GitHubAuthResult{
159160
TenantURL: agent.ServerURL,
161+
UseV2FLow: agent.UseRunnerAdminFlow,
160162
},
161163
PKey: FromRsaParameters(rsaParameters),
162164
Agent: &protocol.TaskAgent{
@@ -182,16 +184,17 @@ func FromRunnerInstance(instance *runnerconfiguration.RunnerInstance, fileAccess
182184
useV2Flow, _ := instance.Agent.Properties.LookupBool("UseV2Flow")
183185
serverV2URL, _ := instance.Agent.Properties.LookupString("ServerUrlV2")
184186
agent := &DotnetAgent{
185-
AgentID: fmt.Sprint(instance.Agent.ID),
186-
AgentName: instance.Agent.Name,
187-
Ephemeral: fmt.Sprint(instance.Agent.Ephemeral),
188-
DisableUpdate: fmt.Sprint(instance.Agent.DisableUpdate),
189-
PoolID: fmt.Sprint(instance.PoolID),
190-
ServerURL: instance.Auth.TenantURL,
191-
WorkFolder: instance.WorkFolder,
192-
GitHubURL: instance.RegistrationURL,
193-
UseV2Flow: useV2Flow,
194-
ServerURLV2: serverV2URL,
187+
AgentID: fmt.Sprint(instance.Agent.ID),
188+
AgentName: instance.Agent.Name,
189+
Ephemeral: fmt.Sprint(instance.Agent.Ephemeral),
190+
DisableUpdate: fmt.Sprint(instance.Agent.DisableUpdate),
191+
PoolID: fmt.Sprint(instance.PoolID),
192+
ServerURL: instance.Auth.TenantURL,
193+
WorkFolder: instance.WorkFolder,
194+
GitHubURL: instance.RegistrationURL,
195+
UseV2Flow: useV2Flow,
196+
ServerURLV2: serverV2URL,
197+
UseRunnerAdminFlow: instance.Auth.UseV2FLow,
195198
}
196199
if agent.WorkFolder == "" {
197200
agent.WorkFolder = "_work"

0 commit comments

Comments
 (0)