shellJoinArgs joins command arguments with proper shell escaping. Arguments containing ${{ }} GitHub Actions expressions are double-quoted; other arguments with special shell characters are single-quoted.
(args []string)
| 13 | // Arguments containing ${{ }} GitHub Actions expressions are double-quoted; |
| 14 | // other arguments with special shell characters are single-quoted. |
| 15 | func shellJoinArgs(args []string) string { |
| 16 | shellLog.Printf("Joining %d shell arguments with escaping", len(args)) |
| 17 | var escapedArgs []string |
| 18 | for _, arg := range args { |
| 19 | escapedArgs = append(escapedArgs, shellEscapeArg(arg)) |
| 20 | } |
| 21 | result := strings.Join(escapedArgs, " ") |
| 22 | shellLog.Print("Shell arguments joined successfully") |
| 23 | return result |
| 24 | } |
| 25 | |
| 26 | // shellEscapeArg escapes a single argument for safe use in shell commands. |
| 27 | // Arguments containing ${{ }} GitHub Actions expressions are double-quoted; |