chore: upgrade dependencies (#2589)

* chore: upgrade dependencies

* fix: linter errors

* chore: bump version of golangci-lint

* chore: go mod tidy

* fix: failing test

* fix: update version of upload-artifact to v4

* chore: format test output with gotestfmt

* fix: typo in test exec

* fix: failing tests

* fix: windows unit test execution

* fix: windows unit test execution

* fix: whitespace
This commit is contained in:
Casey Lee
2024-12-24 13:12:24 -08:00
committed by GitHub
parent e6b5062e5c
commit 7172fc31d1
52 changed files with 392 additions and 505 deletions

View File

@@ -24,13 +24,13 @@ func (a *ActionRunsUsing) UnmarshalYAML(unmarshal func(interface{}) error) error
case ActionRunsUsingNode20, ActionRunsUsingNode16, ActionRunsUsingNode12, ActionRunsUsingDocker, ActionRunsUsingComposite:
*a = format
default:
return fmt.Errorf(fmt.Sprintf("The runs.using key in action.yml must be one of: %v, got %s", []string{
return fmt.Errorf("The runs.using key in action.yml must be one of: %v, got %s", []string{
ActionRunsUsingComposite,
ActionRunsUsingDocker,
ActionRunsUsingNode12,
ActionRunsUsingNode16,
ActionRunsUsingNode20,
}, format))
}, format)
}
return nil
}

View File

@@ -63,9 +63,9 @@ func nestedMapLookup(m map[string]interface{}, ks ...string) (rval interface{})
return rval
} else if m, ok = rval.(map[string]interface{}); !ok {
return nil
} else { // 1+ more keys
return nestedMapLookup(m, ks[1:]...)
}
// 1+ more keys
return nestedMapLookup(m, ks[1:]...)
}
func withDefaultBranch(ctx context.Context, b string, event map[string]interface{}) map[string]interface{} {

View File

@@ -17,11 +17,11 @@ func TestSetRef(t *testing.T) {
defer func() { findGitRef = oldFindGitRef }()
defer func() { findGitRevision = oldFindGitRevision }()
findGitRef = func(ctx context.Context, file string) (string, error) {
findGitRef = func(_ context.Context, _ string) (string, error) {
return "refs/heads/master", nil
}
findGitRevision = func(ctx context.Context, file string) (string, string, error) {
findGitRevision = func(_ context.Context, _ string) (string, string, error) {
return "", "1234fakesha", nil
}
@@ -108,7 +108,7 @@ func TestSetRef(t *testing.T) {
}
t.Run("no-default-branch", func(t *testing.T) {
findGitRef = func(ctx context.Context, file string) (string, error) {
findGitRef = func(_ context.Context, _ string) (string, error) {
return "", fmt.Errorf("no default branch")
}
@@ -131,11 +131,11 @@ func TestSetSha(t *testing.T) {
defer func() { findGitRef = oldFindGitRef }()
defer func() { findGitRevision = oldFindGitRevision }()
findGitRef = func(ctx context.Context, file string) (string, error) {
findGitRef = func(_ context.Context, _ string) (string, error) {
return "refs/heads/master", nil
}
findGitRevision = func(ctx context.Context, file string) (string, string, error) {
findGitRevision = func(_ context.Context, _ string) (string, string, error) {
return "", "1234fakesha", nil
}

View File

@@ -56,8 +56,6 @@ type WorkflowFiles struct {
}
// NewWorkflowPlanner will load a specific workflow, all workflows from a directory or all workflows from a directory and its subdirectories
//
//nolint:gocyclo
func NewWorkflowPlanner(path string, noWorkflowRecurse bool) (WorkflowPlanner, error) {
path, err := filepath.Abs(path)
if err != nil {
@@ -115,9 +113,6 @@ func NewWorkflowPlanner(path string, noWorkflowRecurse bool) (WorkflowPlanner, e
workflowDirEntry: fs.FileInfoToDirEntry(fi),
})
}
if err != nil {
return nil, err
}
wp := new(workflowPlanner)
for _, wf := range workflows {

View File

@@ -566,12 +566,12 @@ type ContainerSpec struct {
// Step is the structure of one step in a job
type Step struct {
ID string `yaml:"id"`
If yaml.Node `yaml:"if"`
Name string `yaml:"name"`
Uses string `yaml:"uses"`
Run string `yaml:"run"`
WorkingDirectory string `yaml:"working-directory"`
ID string `yaml:"id"`
If yaml.Node `yaml:"if"`
Name string `yaml:"name"`
Uses string `yaml:"uses"`
Run string `yaml:"run"`
WorkingDirectory string `yaml:"working-directory"`
// WorkflowShell is the shell really configured in the job, directly at step level or higher in defaults.run.shell
WorkflowShell string `yaml:"-"`
Shell string `yaml:"shell"`

View File

@@ -396,9 +396,9 @@ func TestReadWorkflow_Strategy(t *testing.T) {
func TestStep_ShellCommand(t *testing.T) {
tests := []struct {
shell string
shell string
workflowShell string
want string
want string
}{
{"pwsh -v '. {0}'", "", "pwsh -v '. {0}'"},
{"pwsh", "", "pwsh -command . '{0}'"},