@@ -45,8 +45,9 @@ type DotnetCredentials struct {
4545}
4646
4747type DotnetCredentialsData struct {
48- ClientID string `json:"ClientId"`
49- AuthorizationURL string `json:"AuthorizationUrl"`
48+ ClientID string `json:"ClientId"`
49+ AuthorizationURL string `json:"AuthorizationUrl"`
50+ RequireFipsCryptography bool `json:"RequireFipsCryptography"`
5051}
5152
5253func BytesToBigInt (bytes []byte ) * big.Int {
@@ -159,6 +160,12 @@ func ToRunnerInstance(fileAccess ConfigFileAccess) (*runnerconfiguration.RunnerI
159160 Value : agent .UseV2Flow ,
160161 }
161162 }
163+ if credentials .Data .RequireFipsCryptography {
164+ props ["RequireFipsCryptography" ] = protocol.PropertyValue {
165+ Type : "System.Boolean" ,
166+ Value : credentials .Data .RequireFipsCryptography ,
167+ }
168+ }
162169
163170 return & runnerconfiguration.RunnerInstance {
164171 PoolID : poolID ,
@@ -208,11 +215,15 @@ func FromRunnerInstance(instance *runnerconfiguration.RunnerInstance, fileAccess
208215 if agent .WorkFolder == "" {
209216 agent .WorkFolder = "_work"
210217 }
218+ requireFipsCryptography , hasRequireFipsCryptography := instance .Agent .Properties .LookupBool ("RequireFipsCryptography" )
211219 credentials := & DotnetCredentials {
212220 Scheme : "OAuth" ,
213221 Data : DotnetCredentialsData {
214222 ClientID : instance .Agent .Authorization .ClientID ,
215223 AuthorizationURL : instance .Agent .Authorization .AuthorizationURL ,
224+ // serverV2URL != "" means recent GitHub Server that requires recent actions/runner
225+ // that has received this bugfix https://github.com/actions/runner/pull/3789
226+ RequireFipsCryptography : requireFipsCryptography && hasRequireFipsCryptography || serverV2URL != "" ,
216227 },
217228 }
218229 if err := fileAccess .Write (".runner" , agent ); err != nil {
0 commit comments