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

Method setOutput

pkg/runner/command.go:114–131  ·  view source on GitHub ↗
(ctx context.Context, kvPairs map[string]string, arg string)

Source from the content-addressed store, hash-verified

112 mergeIntoMap(rc.GlobalEnv, newenv)
113}
114func (rc *RunContext) setOutput(ctx context.Context, kvPairs map[string]string, arg string) {
115 logger := common.Logger(ctx)
116 stepID := rc.CurrentStep
117 outputName := kvPairs["name"]
118 if outputMapping, ok := rc.OutputMappings[MappableOutput{StepID: stepID, OutputName: outputName}]; ok {
119 stepID = outputMapping.StepID
120 outputName = outputMapping.OutputName
121 }
122
123 result, ok := rc.StepResults[stepID]
124 if !ok {
125 logger.Infof(" \U00002757 no outputs used step '%s'", stepID)
126 return
127 }
128
129 logger.WithFields(logrus.Fields{"command": "set-output", "name": outputName, "arg": arg}).Infof(" \U00002699 ::set-output:: %s=%s", outputName, arg)
130 result.Outputs[outputName] = arg
131}
132func (rc *RunContext) addPath(ctx context.Context, arg string) {
133 common.Logger(ctx).WithFields(logrus.Fields{"command": "add-path", "arg": arg}).Infof(" \U00002699 ::add-path:: %s", arg)
134 extraPath := []string{arg}

Callers 5

commandHandlerMethod · 0.95
execAsCompositeFunction · 0.80
index.jsFile · 0.80
index.jsFile · 0.80
index.jsFile · 0.80

Calls 1

LoggerFunction · 0.92

Tested by

no test coverage detected