1
0
Fork 0
mirror of https://code.forgejo.org/forgejo/runner.git synced 2025-07-27 17:28:35 +00:00

chore: remove unused code and comments including gitea

This commit is contained in:
Earl Warren 2025-07-03 16:36:40 +02:00
parent f5027efaf8
commit 22ae656783
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
6 changed files with 0 additions and 20 deletions

1
.gitignore vendored
View file

@ -4,7 +4,6 @@ forgejo-runner
.env .env
.runner .runner
coverage.txt coverage.txt
/gitea-vet
/config.yaml /config.yaml
# MS VSCode # MS VSCode

View file

@ -74,12 +74,8 @@ linters-settings:
extra-rules: true extra-rules: true
lang-version: "1.18" lang-version: "1.18"
depguard: depguard:
# TODO: use depguard to replace import checks in gitea-vet
list-type: denylist list-type: denylist
# Check the list against standard lib.
include-go-root: true include-go-root: true
packages-with-error-message:
- github.com/unknwon/com: "use gitea's util and replacements"
issues: issues:
exclude-rules: exclude-rules:

View file

@ -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"
)

View file

@ -99,7 +99,6 @@ func runDaemon(ctx context.Context, configFile *string) func(cmd *cobra.Command,
// declare the labels of the runner before fetching tasks // declare the labels of the runner before fetching tasks
resp, err := runner.Declare(ctx, ls.Names()) resp, err := runner.Declare(ctx, ls.Names())
if err != nil && connect.CodeOf(err) == connect.CodeUnimplemented { 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.") log.Warn("Because the Forgejo instance is an old version, skipping declaring the labels and version.")
} else if err != nil { } else if err != nil {
log.WithError(err).Error("fail to invoke Declare") log.WithError(err).Error("fail to invoke Declare")

View file

@ -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 // declare the labels of the runner before fetching tasks
resp, err := runner.Declare(ctx, ls.Names()) resp, err := runner.Declare(ctx, ls.Names())
if err != nil && connect.CodeOf(err) == connect.CodeUnimplemented { 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.") log.Warn("Because the Forgejo instance is an old version, skipping declaring the labels and version.")
} else if err != nil { } else if err != nil {
log.WithError(err).Error("fail to invoke Declare") log.WithError(err).Error("fail to invoke Declare")

View file

@ -77,12 +77,10 @@ func NewRunner(cfg *config.Config, reg *config.Registration, cli client.Client)
cacheProxy = nil cacheProxy = nil
} }
// set artifact gitea api
artifactGiteaAPI := strings.TrimSuffix(cli.Address(), "/") + "/api/actions_pipeline/" artifactGiteaAPI := strings.TrimSuffix(cli.Address(), "/") + "/api/actions_pipeline/"
envs["ACTIONS_RUNTIME_URL"] = artifactGiteaAPI envs["ACTIONS_RUNTIME_URL"] = artifactGiteaAPI
envs["ACTIONS_RESULTS_URL"] = strings.TrimSuffix(cli.Address(), "/") envs["ACTIONS_RESULTS_URL"] = strings.TrimSuffix(cli.Address(), "/")
// Set specific environments to distinguish between Gitea and GitHub
envs["GITEA_ACTIONS"] = "true" envs["GITEA_ACTIONS"] = "true"
envs["GITEA_ACTIONS_RUNNER_VERSION"] = ver.Version() envs["GITEA_ACTIONS_RUNNER_VERSION"] = ver.Version()