Report error when if expression is invalid (#485)

Co-authored-by: Ed Tan <[email protected]>
Co-authored-by: Casey Lee <[email protected]>
This commit is contained in:
authored and GitHub committed 2021-01-18 11:44:27 -08:00
1 parent 9bbf35e88e
commit c7b3869b2f
2 files changed
+6 -3

No files matched your search

+5 -2
View File
@@ -2,13 +2,14 @@ package runner
import (
"fmt"
"github.com/nektos/act/pkg/model"
a "github.com/stretchr/testify/assert"
"os"
"regexp"
"strings"
"testing"
"github.com/nektos/act/pkg/model"
a "github.com/stretchr/testify/assert"
"github.com/sirupsen/logrus/hooks/test"
)
@@ -129,6 +130,8 @@ func TestRunContext_EvalBool(t *testing.T) {
// The special ACT flag
{in: "${{ env.ACT }}", out: true},
{in: "${{ !env.ACT }}", out: false},
// Invalid expressions should be reported
{in: "INVALID_EXPRESSION", wantErr: true},
}
updateTestIfWorkflow(t, tables, rc)