Fix yaml with prefixed newline broken setjob + yaml v4 (#144)

* go-yaml v3 **and** v4 workaround
* avoid yaml.Marshal broken indention

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-on: https://gitea.com/gitea/act/pulls/144
Reviewed-by: wxiaoguang <wxiaoguang@noreply.gitea.com>
Reviewed-by: Zettat123 <zettat123@noreply.gitea.com>
Co-authored-by: Christopher Homberger <christopher.homberger@web.de>
Co-committed-by: Christopher Homberger <christopher.homberger@web.de>
This commit is contained in:
Christopher Homberger
2025-12-09 02:28:56 +00:00
committed by Lunny Xiao
parent 5417d3ac67
commit 3a07d231a0
20 changed files with 62 additions and 23 deletions

View File

@@ -16,7 +16,7 @@ import (
"github.com/nektos/act/pkg/container"
"github.com/nektos/act/pkg/exprparser"
"github.com/nektos/act/pkg/model"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"
)
// ExpressionEvaluator is the interface for evaluating expressions

View File

@@ -11,7 +11,7 @@ import (
"github.com/nektos/act/pkg/exprparser"
"github.com/nektos/act/pkg/model"
assert "github.com/stretchr/testify/assert"
yaml "gopkg.in/yaml.v3"
yaml "go.yaml.in/yaml/v4"
)
func createRunContext(t *testing.T) *RunContext {

View File

@@ -15,7 +15,7 @@ import (
log "github.com/sirupsen/logrus"
assert "github.com/stretchr/testify/assert"
yaml "gopkg.in/yaml.v3"
yaml "go.yaml.in/yaml/v4"
)
func TestRunContext_EvalBool(t *testing.T) {

View File

@@ -15,7 +15,7 @@ import (
"github.com/joho/godotenv"
log "github.com/sirupsen/logrus"
assert "github.com/stretchr/testify/assert"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"
"github.com/nektos/act/pkg/common"
"github.com/nektos/act/pkg/model"

View File

@@ -12,7 +12,7 @@ import (
"github.com/nektos/act/pkg/model"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"
)
type stepActionLocalMocks struct {

View File

@@ -10,7 +10,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v4"
"github.com/nektos/act/pkg/common"
"github.com/nektos/act/pkg/common/git"

View File

@@ -9,7 +9,7 @@ import (
log "github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
yaml "gopkg.in/yaml.v3"
yaml "go.yaml.in/yaml/v4"
)
func TestMergeIntoMap(t *testing.T) {