Skip to content

Commit

Permalink
fix #117 - handle whitespace in actrc secrets (#118)
Browse files Browse the repository at this point in the history
* fix #117 - handle whitespace in actrc secrets

* Switch to raw string on regex pattern

Co-authored-by: Casey Lee <[email protected]>
  • Loading branch information
Steffen911 and cplee authored Mar 2, 2020
1 parent a5570ff commit 4f84be1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
"os"
"path/filepath"
"regexp"
"strings"

"github.com/nektos/act/pkg/common"
Expand Down Expand Up @@ -74,7 +75,7 @@ func readArgsFile(file string) []string {
for scanner.Scan() {
arg := scanner.Text()
if strings.HasPrefix(arg, "-") {
args = append(args, strings.Fields(arg)...)
args = append(args, regexp.MustCompile(`\s`).Split(arg, 2)...)
}
}
return args
Expand Down
2 changes: 1 addition & 1 deletion cmd/secrets.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type secrets map[string]string
func newSecrets(secretList []string) secrets {
s := make(map[string]string)
for _, secretPair := range secretList {
secretPairParts := strings.Split(secretPair, "=")
secretPairParts := strings.SplitN(secretPair, "=", 2)
if len(secretPairParts) == 2 {
s[secretPairParts[0]] = secretPairParts[1]
} else if env, ok := os.LookupEnv(secretPairParts[0]); ok && env != "" {
Expand Down

0 comments on commit 4f84be1

Please sign in to comment.