mirror of https://gitea.com/gitea/act_runner.git
chore(lint): remove unused function parameters instead of renaming to _
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
8f73c36918
commit
aa7351507a
|
|
@ -4,7 +4,6 @@
|
|||
package cmd
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
"os/signal"
|
||||
|
|
@ -22,7 +21,7 @@ type cacheServerArgs struct {
|
|||
Port uint16
|
||||
}
|
||||
|
||||
func runCacheServer(_ context.Context, configFile *string, cacheArgs *cacheServerArgs) func(cmd *cobra.Command, args []string) error {
|
||||
func runCacheServer(configFile *string, cacheArgs *cacheServerArgs) func(cmd *cobra.Command, args []string) error {
|
||||
return func(cmd *cobra.Command, args []string) error {
|
||||
cfg, err := config.LoadDefault(*configFile)
|
||||
if err != nil {
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ func Execute(ctx context.Context) {
|
|||
Use: "cache-server",
|
||||
Short: "Start a cache server for the cache action",
|
||||
Args: cobra.MaximumNArgs(0),
|
||||
RunE: runCacheServer(ctx, &configFile, &cacheArgs),
|
||||
RunE: runCacheServer(&configFile, &cacheArgs),
|
||||
}
|
||||
cacheCmd.Flags().StringVarP(&cacheArgs.Dir, "dir", "d", "", "Cache directory")
|
||||
cacheCmd.Flags().StringVarP(&cacheArgs.Host, "host", "s", "", "Host of the cache server")
|
||||
|
|
|
|||
|
|
@ -263,7 +263,7 @@ func printList(plan *model.Plan) {
|
|||
}
|
||||
}
|
||||
|
||||
func runExecList(_ context.Context, planner model.WorkflowPlanner, execArgs *executeArgs) error {
|
||||
func runExecList(planner model.WorkflowPlanner, execArgs *executeArgs) error {
|
||||
// plan with filtered jobs - to be used for filtering only
|
||||
var filterPlan *model.Plan
|
||||
|
||||
|
|
@ -318,7 +318,7 @@ func runExec(ctx context.Context, execArgs *executeArgs) func(cmd *cobra.Command
|
|||
}
|
||||
|
||||
if execArgs.runList {
|
||||
return runExecList(ctx, planner, execArgs)
|
||||
return runExecList(planner, execArgs)
|
||||
}
|
||||
|
||||
// plan with triggered jobs
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ func (r *Runner) Run(ctx context.Context, task *runnerv1.Task) error {
|
|||
// getDefaultActionsURL
|
||||
// when DEFAULT_ACTIONS_URL == "https://github.com" and GithubMirror is not blank,
|
||||
// it should be set to GithubMirror first.
|
||||
func (r *Runner) getDefaultActionsURL(_ context.Context, task *runnerv1.Task) string {
|
||||
func (r *Runner) getDefaultActionsURL(task *runnerv1.Task) string {
|
||||
giteaDefaultActionsURL := task.Context.Fields["gitea_default_actions_url"].GetStringValue()
|
||||
if giteaDefaultActionsURL == "https://github.com" && r.cfg.Runner.GithubMirror != "" {
|
||||
return r.cfg.Runner.GithubMirror
|
||||
|
|
@ -147,7 +147,7 @@ func (r *Runner) run(ctx context.Context, task *runnerv1.Task, reporter *report.
|
|||
taskContext := task.Context.Fields
|
||||
|
||||
log.Infof("task %v repo is %v %v %v", task.Id, taskContext["repository"].GetStringValue(),
|
||||
r.getDefaultActionsURL(ctx, task),
|
||||
r.getDefaultActionsURL(task),
|
||||
r.client.Address())
|
||||
|
||||
preset := &model.GithubContext{
|
||||
|
|
@ -221,7 +221,7 @@ func (r *Runner) run(ctx context.Context, task *runnerv1.Task, reporter *report.
|
|||
ContainerOptions: r.cfg.Container.Options,
|
||||
ContainerDaemonSocket: r.cfg.Container.DockerHost,
|
||||
Privileged: r.cfg.Container.Privileged,
|
||||
DefaultActionInstance: r.getDefaultActionsURL(ctx, task),
|
||||
DefaultActionInstance: r.getDefaultActionsURL(task),
|
||||
PlatformPicker: r.labels.PickPlatform,
|
||||
Vars: task.Vars,
|
||||
ValidVolumes: r.cfg.Container.ValidVolumes,
|
||||
|
|
|
|||
|
|
@ -374,7 +374,7 @@ func (r *Reporter) parseResult(result any) (runnerv1.Result, bool) {
|
|||
|
||||
var cmdRegex = regexp.MustCompile(`^::([^ :]+)( .*)?::(.*)$`)
|
||||
|
||||
func (r *Reporter) handleCommand(originalContent, command, _, value string) *string {
|
||||
func (r *Reporter) handleCommand(originalContent, command, value string) *string {
|
||||
if r.stopCommandEndToken != "" && command != r.stopCommandEndToken {
|
||||
return &originalContent
|
||||
}
|
||||
|
|
@ -420,7 +420,7 @@ func (r *Reporter) parseLogRow(entry *log.Entry) *runnerv1.LogRow {
|
|||
|
||||
matches := cmdRegex.FindStringSubmatch(content)
|
||||
if matches != nil {
|
||||
if output := r.handleCommand(content, matches[1], matches[2], matches[3]); output != nil {
|
||||
if output := r.handleCommand(content, matches[1], matches[3]); output != nil {
|
||||
content = *output
|
||||
} else {
|
||||
return nil
|
||||
|
|
|
|||
Loading…
Reference in New Issue