MCPcopy
hub / github.com/nektos/act / handleServiceCredentials

Method handleServiceCredentials

pkg/runner/run_context.go:1129–1150  ·  view source on GitHub ↗
(ctx context.Context, creds map[string]string)

Source from the content-addressed store, hash-verified

1127}
1128
1129func (rc *RunContext) handleServiceCredentials(ctx context.Context, creds map[string]string) (username, password string, err error) {
1130 if creds == nil {
1131 return
1132 }
1133 if len(creds) != 2 {
1134 err = fmt.Errorf("invalid property count for key 'credentials:'")
1135 return
1136 }
1137
1138 ee := rc.NewExpressionEvaluator(ctx)
1139 if username = ee.Interpolate(ctx, creds["username"]); username == "" {
1140 err = fmt.Errorf("failed to interpolate credentials.username")
1141 return
1142 }
1143
1144 if password = ee.Interpolate(ctx, creds["password"]); password == "" {
1145 err = fmt.Errorf("failed to interpolate credentials.password")
1146 return
1147 }
1148
1149 return
1150}
1151
1152// GetServiceBindsAndMounts returns the binds and mounts for the service container, resolving paths as appropriate
1153func (rc *RunContext) GetServiceBindsAndMounts(svcVolumes []string) ([]string, map[string]string) {

Callers 1

startJobContainerMethod · 0.95

Calls 2

InterpolateMethod · 0.95

Tested by

no test coverage detected