1
0
Fork 0
mirror of https://code.forgejo.org/forgejo/runner.git synced 2025-09-15 18:57:01 +00:00

Report error when if expression is invalid (#485)

Co-authored-by: Ed Tan <edtan@users.noreply.github.com>
Co-authored-by: Casey Lee <cplee@nektos.com>
This commit is contained in:
Ed 2021-01-18 14:44:27 -05:00 committed by GitHub
parent 0f5e9b0a60
commit 0d8e2101cb
2 changed files with 6 additions and 3 deletions

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)