Avoid using log.Fatal in pkg/* (#39)

Follow https://github.com/nektos/act/pull/1705

Reviewed-on: https://gitea.com/gitea/act/pulls/39
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Jason Song <i@wolfogre.com>
Co-committed-by: Jason Song <i@wolfogre.com>
This commit is contained in:
Jason Song
2023-04-07 16:31:03 +08:00
committed by Lunny Xiao
parent 62abf4fe11
commit 5c4a96bcb7
4 changed files with 63 additions and 36 deletions

View File

@@ -7,11 +7,11 @@ import (
"os"
"time"
log "github.com/sirupsen/logrus"
"github.com/nektos/act/pkg/common"
"github.com/nektos/act/pkg/container"
"github.com/nektos/act/pkg/model"
log "github.com/sirupsen/logrus"
)
// Runner provides capabilities to run GitHub actions
@@ -136,7 +136,11 @@ func (runner *runnerImpl) NewPlanExecutor(plan *model.Plan) common.Executor {
log.Errorf("Error while evaluating matrix: %v", err)
}
}
matrixes := job.GetMatrixes()
matrixes, err := job.GetMatrixes()
if err != nil {
log.Errorf("Error while get job's matrix: %v", err)
// fall back to empty matrixes
}
maxParallel := 4
if job.Strategy != nil {
maxParallel = job.Strategy.MaxParallel