From a3738b9032436bd694773f11e3e77b36925da763 Mon Sep 17 00:00:00 2001 From: xtex Date: Sat, 4 Jan 2025 20:01:43 +0800 Subject: feat: export runtime token as FORGEJO_TOKEN --- pkg/runner/run_context.go | 1 + pkg/runner/run_context_test.go | 1 + 2 files changed, 2 insertions(+) diff --git a/pkg/runner/run_context.go b/pkg/runner/run_context.go index 3597ce6..a833324 100644 --- a/pkg/runner/run_context.go +++ b/pkg/runner/run_context.go @@ -1198,6 +1198,7 @@ func (rc *RunContext) withGithubEnv(ctx context.Context, github *model.GithubCon env["GITHUB_REF_NAME"] = github.RefName env["GITHUB_REF_TYPE"] = github.RefType env["GITHUB_TOKEN"] = github.Token + env["FORGEJO_TOKEN"] = github.Token env["GITHUB_JOB"] = github.Job env["GITHUB_REPOSITORY_OWNER"] = github.RepositoryOwner env["GITHUB_RETENTION_DAYS"] = github.RetentionDays diff --git a/pkg/runner/run_context_test.go b/pkg/runner/run_context_test.go index af0cd4e..b86638f 100644 --- a/pkg/runner/run_context_test.go +++ b/pkg/runner/run_context_test.go @@ -394,6 +394,7 @@ func TestGetGitHubContext(t *testing.T) { assert.Equal(t, ghc.RepositoryOwner, owner) assert.Equal(t, ghc.RunnerPerflog, "/dev/null") assert.Equal(t, ghc.Token, rc.Config.Secrets["GITHUB_TOKEN"]) + assert.Equal(t, ghc.Token, rc.Config.Secrets["FORGEJO_TOKEN"]) assert.Equal(t, ghc.Job, "job1") } -- cgit v1.2.3