summaryrefslogtreecommitdiffstats
path: root/pkg/runner
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/runner')
-rw-r--r--pkg/runner/action.go6
-rw-r--r--pkg/runner/expression.go2
-rw-r--r--pkg/runner/job_executor.go1
-rw-r--r--pkg/runner/reusable_workflow.go18
-rw-r--r--pkg/runner/run_context.go5
5 files changed, 4 insertions, 28 deletions
diff --git a/pkg/runner/action.go b/pkg/runner/action.go
index fd52c0b..b26e52a 100644
--- a/pkg/runner/action.go
+++ b/pkg/runner/action.go
@@ -213,14 +213,14 @@ func runActionImpl(step actionStep, actionDir string, remoteAction *remoteAction
rc.execJobContainer(execArgs, *step.getEnv(), "", ""),
)(ctx)
default:
- return fmt.Errorf(fmt.Sprintf("The runs.using key must be one of: %v, got %s", []string{
+ return fmt.Errorf("The runs.using key must be one of: %v, got %s", []string{
model.ActionRunsUsingDocker,
model.ActionRunsUsingNode12,
model.ActionRunsUsingNode16,
model.ActionRunsUsingNode20,
model.ActionRunsUsingComposite,
model.ActionRunsUsingGo,
- }, action.Runs.Using))
+ }, action.Runs.Using)
}
}
}
@@ -257,8 +257,6 @@ func removeGitIgnore(ctx context.Context, directory string) error {
}
// TODO: break out parts of function to reduce complexicity
-//
-//nolint:gocyclo
func execAsDocker(ctx context.Context, step actionStep, actionName string, basedir string, localAction bool) error {
logger := common.Logger(ctx)
rc := step.getRunContext()
diff --git a/pkg/runner/expression.go b/pkg/runner/expression.go
index 412d1c0..ae3f145 100644
--- a/pkg/runner/expression.go
+++ b/pkg/runner/expression.go
@@ -403,7 +403,6 @@ func escapeFormatString(in string) string {
return strings.ReplaceAll(strings.ReplaceAll(in, "{", "{{"), "}", "}}")
}
-//nolint:gocyclo
func rewriteSubExpression(ctx context.Context, in string, forceFormat bool) (string, error) {
if !strings.Contains(in, "${{") || !strings.Contains(in, "}}") {
return in, nil
@@ -470,7 +469,6 @@ func rewriteSubExpression(ctx context.Context, in string, forceFormat bool) (str
return out, nil
}
-//nolint:gocyclo
func getEvaluatorInputs(ctx context.Context, rc *RunContext, step step, ghc *model.GithubContext) map[string]interface{} {
inputs := map[string]interface{}{}
diff --git a/pkg/runner/job_executor.go b/pkg/runner/job_executor.go
index 0a86683..ed40563 100644
--- a/pkg/runner/job_executor.go
+++ b/pkg/runner/job_executor.go
@@ -20,7 +20,6 @@ type jobInfo interface {
result(result string)
}
-//nolint:contextcheck,gocyclo
func newJobExecutor(info jobInfo, sf stepFactory, rc *RunContext) common.Executor {
steps := make([]common.Executor, 0)
preSteps := make([]common.Executor, 0)
diff --git a/pkg/runner/reusable_workflow.go b/pkg/runner/reusable_workflow.go
index 717913f..9d87365 100644
--- a/pkg/runner/reusable_workflow.go
+++ b/pkg/runner/reusable_workflow.go
@@ -225,21 +225,3 @@ func newRemoteReusableWorkflowWithPlat(url, uses string) *remoteReusableWorkflow
URL: url,
}
}
-
-// deprecated: use newRemoteReusableWorkflowWithPlat
-func newRemoteReusableWorkflow(uses string) *remoteReusableWorkflow {
- // GitHub docs:
- // https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_iduses
- r := regexp.MustCompile(`^([^/]+)/([^/]+)/.github/workflows/([^@]+)@(.*)$`)
- matches := r.FindStringSubmatch(uses)
- if len(matches) != 5 {
- return nil
- }
- return &remoteReusableWorkflow{
- Org: matches[1],
- Repo: matches[2],
- Filename: matches[3],
- Ref: matches[4],
- URL: "https://github.com",
- }
-}
diff --git a/pkg/runner/run_context.go b/pkg/runner/run_context.go
index 6aaf2d8..3597ce6 100644
--- a/pkg/runner/run_context.go
+++ b/pkg/runner/run_context.go
@@ -391,7 +391,6 @@ func (rc *RunContext) startHostEnvironment() common.Executor {
}
}
-//nolint:gocyclo
func (rc *RunContext) startJobContainer() common.Executor {
return func(ctx context.Context) error {
logger := common.Logger(ctx)
@@ -591,7 +590,7 @@ func (rc *RunContext) execJobContainer(cmd []string, env map[string]string, user
}
func (rc *RunContext) ApplyExtraPath(ctx context.Context, env *map[string]string) {
- if rc.ExtraPath != nil && len(rc.ExtraPath) > 0 {
+ if len(rc.ExtraPath) > 0 {
path := rc.JobContainer.GetPathVariableName()
if rc.JobContainer.IsEnvironmentCaseInsensitive() {
// On windows system Path and PATH could also be in the map
@@ -939,7 +938,7 @@ func mergeMaps(maps ...map[string]string) map[string]string {
return rtnMap
}
-// deprecated: use createSimpleContainerName
+// Deprecated: use createSimpleContainerName
func createContainerName(parts ...string) string {
name := strings.Join(parts, "-")
pattern := regexp.MustCompile("[^a-zA-Z0-9]")