From c248520a6689db42757fd780b0fa96cd8c250f95 Mon Sep 17 00:00:00 2001 From: Jason Song Date: Wed, 12 Apr 2023 14:44:26 +0800 Subject: [PATCH] Set specific environments to distinguish between Gitea and GitHub (#113) Close https://github.com/go-gitea/gitea/issues/24038 Reviewed-on: https://gitea.com/gitea/act_runner/pulls/113 Reviewed-by: techknowlogick Reviewed-by: Lunny Xiao Co-authored-by: Jason Song Co-committed-by: Jason Song --- internal/app/run/runner.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/app/run/runner.go b/internal/app/run/runner.go index e228b9b..076418c 100644 --- a/internal/app/run/runner.go +++ b/internal/app/run/runner.go @@ -65,6 +65,10 @@ func NewRunner(cfg *config.Config, reg *config.Registration, cli client.Client) artifactGiteaAPI := strings.TrimSuffix(cli.Address(), "/") + "/api/actions_pipeline/" envs["ACTIONS_RUNTIME_URL"] = artifactGiteaAPI + // Set specific environments to distinguish between Gitea and GitHub + envs["GITEA_ACTIONS"] = "true" + envs["GITEA_ACTIONS_RUNNER_VERSION"] = ver.Version() + return &Runner{ name: reg.Name, cfg: cfg,