* fix #117 - handle whitespace in actrc secrets * Switch to raw string on regex pattern Co-authored-by: Casey Lee <cplee@nektos.com>
This commit is contained in:
parent
a5570ffdd6
commit
4f84be12e3
2 changed files with 3 additions and 2 deletions
|
@ -6,6 +6,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/nektos/act/pkg/common"
|
"github.com/nektos/act/pkg/common"
|
||||||
|
@ -74,7 +75,7 @@ func readArgsFile(file string) []string {
|
||||||
for scanner.Scan() {
|
for scanner.Scan() {
|
||||||
arg := scanner.Text()
|
arg := scanner.Text()
|
||||||
if strings.HasPrefix(arg, "-") {
|
if strings.HasPrefix(arg, "-") {
|
||||||
args = append(args, strings.Fields(arg)...)
|
args = append(args, regexp.MustCompile(`\s`).Split(arg, 2)...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return args
|
return args
|
||||||
|
|
|
@ -14,7 +14,7 @@ type secrets map[string]string
|
||||||
func newSecrets(secretList []string) secrets {
|
func newSecrets(secretList []string) secrets {
|
||||||
s := make(map[string]string)
|
s := make(map[string]string)
|
||||||
for _, secretPair := range secretList {
|
for _, secretPair := range secretList {
|
||||||
secretPairParts := strings.Split(secretPair, "=")
|
secretPairParts := strings.SplitN(secretPair, "=", 2)
|
||||||
if len(secretPairParts) == 2 {
|
if len(secretPairParts) == 2 {
|
||||||
s[secretPairParts[0]] = secretPairParts[1]
|
s[secretPairParts[0]] = secretPairParts[1]
|
||||||
} else if env, ok := os.LookupEnv(secretPairParts[0]); ok && env != "" {
|
} else if env, ok := os.LookupEnv(secretPairParts[0]); ok && env != "" {
|
||||||
|
|
Loading…
Reference in a new issue