From 22ae656783cf957d196e2aa7ab9f508f83194ec2 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Thu, 3 Jul 2025 16:36:40 +0200 Subject: [PATCH] chore: remove unused code and comments including gitea --- .gitignore | 1 - .golangci.yml | 4 ---- build.go | 11 ----------- internal/app/cmd/daemon.go | 1 - internal/app/cmd/job.go | 1 - internal/app/run/runner.go | 2 -- 6 files changed, 20 deletions(-) delete mode 100644 build.go diff --git a/.gitignore b/.gitignore index 57ec96d..ad418a7 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,6 @@ forgejo-runner .env .runner coverage.txt -/gitea-vet /config.yaml # MS VSCode diff --git a/.golangci.yml b/.golangci.yml index 41f9683..ba1d411 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -74,12 +74,8 @@ linters-settings: extra-rules: true lang-version: "1.18" depguard: - # TODO: use depguard to replace import checks in gitea-vet list-type: denylist - # Check the list against standard lib. include-go-root: true - packages-with-error-message: - - github.com/unknwon/com: "use gitea's util and replacements" issues: exclude-rules: diff --git a/build.go b/build.go deleted file mode 100644 index f2e5d82..0000000 --- a/build.go +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright 2023 The Gitea Authors. All rights reserved. -// SPDX-License-Identifier: MIT - -//go:build vendor - -package main - -import ( - // for vet - _ "code.gitea.io/gitea-vet" -) diff --git a/internal/app/cmd/daemon.go b/internal/app/cmd/daemon.go index a02f36d..38f1cf2 100644 --- a/internal/app/cmd/daemon.go +++ b/internal/app/cmd/daemon.go @@ -99,7 +99,6 @@ func runDaemon(ctx context.Context, configFile *string) func(cmd *cobra.Command, // declare the labels of the runner before fetching tasks resp, err := runner.Declare(ctx, ls.Names()) if err != nil && connect.CodeOf(err) == connect.CodeUnimplemented { - // Gitea instance is older version. skip declare step. log.Warn("Because the Forgejo instance is an old version, skipping declaring the labels and version.") } else if err != nil { log.WithError(err).Error("fail to invoke Declare") diff --git a/internal/app/cmd/job.go b/internal/app/cmd/job.go index a4ded06..91d8dee 100644 --- a/internal/app/cmd/job.go +++ b/internal/app/cmd/job.go @@ -95,7 +95,6 @@ func runJob(ctx context.Context, configFile *string) func(cmd *cobra.Command, ar // declare the labels of the runner before fetching tasks resp, err := runner.Declare(ctx, ls.Names()) if err != nil && connect.CodeOf(err) == connect.CodeUnimplemented { - // Gitea instance is older version. skip declare step. log.Warn("Because the Forgejo instance is an old version, skipping declaring the labels and version.") } else if err != nil { log.WithError(err).Error("fail to invoke Declare") diff --git a/internal/app/run/runner.go b/internal/app/run/runner.go index 4f12151..3c00989 100644 --- a/internal/app/run/runner.go +++ b/internal/app/run/runner.go @@ -77,12 +77,10 @@ func NewRunner(cfg *config.Config, reg *config.Registration, cli client.Client) cacheProxy = nil } - // set artifact gitea api artifactGiteaAPI := strings.TrimSuffix(cli.Address(), "/") + "/api/actions_pipeline/" envs["ACTIONS_RUNTIME_URL"] = artifactGiteaAPI envs["ACTIONS_RESULTS_URL"] = strings.TrimSuffix(cli.Address(), "/") - // Set specific environments to distinguish between Gitea and GitHub envs["GITEA_ACTIONS"] = "true" envs["GITEA_ACTIONS_RUNNER_VERSION"] = ver.Version()