Skip to content

Commit

Permalink
fix: [CI-13938]: action multiline output variables (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
devkimittal authored Sep 17, 2024
1 parent 4801f2a commit a56c541
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions plugin/github/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,16 +124,14 @@ func getOutputVariables(prevStepId, outputFile string, outputVars []string) step
skip := len(outputFile) == 0 || len(outputVars) == 0
cmd := ""
for _, outputVar := range outputVars {
cmd += fmt.Sprintf("print('%s'+'='+'${{ steps.%s.outputs.%s }}'); ", outputVar, prevStepId, outputVar)
cmd += fmt.Sprintf("%s=${{ steps.%s.outputs.%s }}\n", outputVar, prevStepId, outputVar)
}

if runtime.GOOS == "darwin" && runtime.GOARCH == "arm64" {
cmd = fmt.Sprintf("python3 -c \"%s\" > %s", cmd, outputFile)
} else if runtime.GOOS == "windows" {
if runtime.GOOS == "windows" {
cmd = fmt.Sprintf("python -c \"%s\"", outputVarWinScript(
outputVars, prevStepId, outputFile))
} else {
cmd = fmt.Sprintf("python -c \"%s\" > %s", cmd, outputFile)
cmd = fmt.Sprintf("echo \"%s\" > %s", cmd, outputFile)
}

s := step{
Expand Down

0 comments on commit a56c541

Please sign in to comment.